@@ -879,10 +951,6 @@ class BorderDirectional extends BoxBorder {
}
}
assert(borderRadius==null,'A borderRadius can only be given for uniform borders.');
assert(shape==BoxShape.rectangle,'A border can only be drawn as a circle if it is uniform.');
assert(_strokeAlignIsUniform&&top.strokeAlign==BorderSide.strokeAlignInside,'A Border can only draw strokeAlign different than strokeAlignInside on uniform borders.');
finalBorderSideleft,right;
assert(textDirection!=null,'Non-uniform BorderDirectional objects require a TextDirection when painting.');
switch(textDirection!){
...
...
@@ -893,6 +961,29 @@ class BorderDirectional extends BoxBorder {
left=start;
right=end;
}
// Allow painting non-uniform borders if the color and style are uniform.
if(_colorIsUniform&&_styleIsUniform){
switch(top.style){
caseBorderStyle.none:
return;
caseBorderStyle.solid:
BoxBorder._paintNonUniformBorder(canvas,rect,
shape:shape,
borderRadius:borderRadius,
textDirection:textDirection,
left:left,
top:top,
right:right,
bottom:bottom);
return;
}
}
assert(borderRadius==null,'A borderRadius can only be given for borders with uniform colors and styles.');
assert(shape==BoxShape.rectangle,'A Border can only be drawn as a circle on borders with uniform colors and styles.');
assert(_strokeAlignIsUniform&&top.strokeAlign==BorderSide.strokeAlignInside,'A Border can only draw strokeAlign different than strokeAlignInside on borders with uniform colors and styles.');