@@ -66,11 +66,7 @@ class BorderSide with Diagnosticable {
66
66
this .width = 1.0 ,
67
67
this .style = BorderStyle .solid,
68
68
this .strokeAlign = strokeAlignInside,
69
- }) : assert (color != null ),
70
- assert (width != null ),
71
- assert (width >= 0.0 ),
72
- assert (style != null ),
73
- assert (strokeAlign != null );
69
+ }) : assert (width >= 0.0 );
74
70
75
71
/// Creates a [BorderSide] that represents the addition of the two given
76
72
/// [BorderSide] s.
@@ -84,8 +80,6 @@ class BorderSide with Diagnosticable {
84
80
///
85
81
/// The arguments must not be null.
86
82
static BorderSide merge (BorderSide a, BorderSide b) {
87
- assert (a != null );
88
- assert (b != null );
89
83
assert (canMerge (a, b));
90
84
final bool aIsNone = a.style == BorderStyle .none && a.width == 0.0 ;
91
85
final bool bIsNone = b.style == BorderStyle .none && b.width == 0.0 ;
@@ -202,7 +196,6 @@ class BorderSide with Diagnosticable {
202
196
/// Values for `t` are usually obtained from an [Animation<double>] , such as
203
197
/// an [AnimationController] .
204
198
BorderSide scale (double t) {
205
- assert (t != null );
206
199
return BorderSide (
207
200
color: color,
208
201
width: math.max (0.0 , width * t),
@@ -239,8 +232,6 @@ class BorderSide with Diagnosticable {
239
232
///
240
233
/// The arguments must not be null.
241
234
static bool canMerge (BorderSide a, BorderSide b) {
242
- assert (a != null );
243
- assert (b != null );
244
235
if ((a.style == BorderStyle .none && a.width == 0.0 ) ||
245
236
(b.style == BorderStyle .none && b.width == 0.0 )) {
246
237
return true ;
@@ -255,9 +246,6 @@ class BorderSide with Diagnosticable {
255
246
///
256
247
/// {@macro dart.ui.shadow.lerp}
257
248
static BorderSide lerp (BorderSide a, BorderSide b, double t) {
258
- assert (a != null );
259
- assert (b != null );
260
- assert (t != null );
261
249
if (t == 0.0 ) {
262
250
return a;
263
251
}
@@ -517,7 +505,6 @@ abstract class ShapeBorder {
517
505
///
518
506
/// {@macro dart.ui.shadow.lerp}
519
507
static ShapeBorder ? lerp (ShapeBorder ? a, ShapeBorder ? b, double t) {
520
- assert (t != null );
521
508
ShapeBorder ? result;
522
509
if (b != null ) {
523
510
result = b.lerpFrom (a, t);
@@ -664,7 +651,7 @@ abstract class OutlinedBorder extends ShapeBorder {
664
651
/// const constructors so that they can be used in const expressions.
665
652
///
666
653
/// The value of [side] must not be null.
667
- const OutlinedBorder ({ this .side = BorderSide .none }) : assert (side != null ) ;
654
+ const OutlinedBorder ({ this .side = BorderSide .none });
668
655
669
656
@override
670
657
EdgeInsetsGeometry get dimensions => EdgeInsets .all (math.max (side.strokeInset, 0 ));
@@ -707,7 +694,6 @@ abstract class OutlinedBorder extends ShapeBorder {
707
694
///
708
695
/// {@macro dart.ui.shadow.lerp}
709
696
static OutlinedBorder ? lerp (OutlinedBorder ? a, OutlinedBorder ? b, double t) {
710
- assert (t != null );
711
697
ShapeBorder ? result;
712
698
if (b != null ) {
713
699
result = b.lerpFrom (a, t);
@@ -724,8 +710,7 @@ abstract class OutlinedBorder extends ShapeBorder {
724
710
/// The borders are listed from the outside to the inside.
725
711
class _CompoundBorder extends ShapeBorder {
726
712
_CompoundBorder (this .borders)
727
- : assert (borders != null ),
728
- assert (borders.length >= 2 ),
713
+ : assert (borders.length >= 2 ),
729
714
assert (! borders.any ((ShapeBorder border) => border is _CompoundBorder ));
730
715
731
716
final List <ShapeBorder > borders;
@@ -788,7 +773,6 @@ class _CompoundBorder extends ShapeBorder {
788
773
}
789
774
790
775
static _CompoundBorder lerp (ShapeBorder ? a, ShapeBorder ? b, double t) {
791
- assert (t != null );
792
776
assert (a is _CompoundBorder || b is _CompoundBorder ); // Not really necessary, but all call sites currently intend this.
793
777
final List <ShapeBorder ?> aList = a is _CompoundBorder ? a.borders : < ShapeBorder ? > [a];
794
778
final List <ShapeBorder ?> bList = b is _CompoundBorder ? b.borders : < ShapeBorder ? > [b];
@@ -897,12 +881,6 @@ void paintBorder(
897
881
BorderSide bottom = BorderSide .none,
898
882
BorderSide left = BorderSide .none,
899
883
}) {
900
- assert (canvas != null );
901
- assert (rect != null );
902
- assert (top != null );
903
- assert (right != null );
904
- assert (bottom != null );
905
- assert (left != null );
906
884
907
885
// We draw the borders as filled shapes, unless the borders are hairline
908
886
// borders, in which case we use PaintingStyle.stroke, with the stroke width
0 commit comments