@@ -96,10 +96,7 @@ class BoxConstraints extends Constraints {
96
96
this .maxWidth = double .infinity,
97
97
this .minHeight = 0.0 ,
98
98
this .maxHeight = double .infinity,
99
- }) : assert (minWidth != null ),
100
- assert (maxWidth != null ),
101
- assert (minHeight != null ),
102
- assert (maxHeight != null );
99
+ });
103
100
104
101
/// Creates box constraints that is respected only by the given size.
105
102
BoxConstraints .tight (Size size)
@@ -190,7 +187,6 @@ class BoxConstraints extends Constraints {
190
187
191
188
/// Returns new box constraints that are smaller by the given edge dimensions.
192
189
BoxConstraints deflate (EdgeInsets edges) {
193
- assert (edges != null );
194
190
assert (debugAssertIsValid ());
195
191
final double horizontal = edges.horizontal;
196
192
final double vertical = edges.vertical;
@@ -472,7 +468,6 @@ class BoxConstraints extends Constraints {
472
468
///
473
469
/// {@macro dart.ui.shadow.lerp}
474
470
static BoxConstraints ? lerp (BoxConstraints ? a, BoxConstraints ? b, double t) {
475
- assert (t != null );
476
471
if (a == null && b == null ) {
477
472
return null ;
478
473
}
@@ -762,8 +757,6 @@ class BoxHitTestResult extends HitTestResult {
762
757
required Offset position,
763
758
required BoxHitTest hitTest,
764
759
}) {
765
- assert (position != null );
766
- assert (hitTest != null );
767
760
if (transform != null ) {
768
761
transform = Matrix4 .tryInvert (PointerEvent .removePerspectiveTransform (transform));
769
762
if (transform == null ) {
@@ -801,8 +794,6 @@ class BoxHitTestResult extends HitTestResult {
801
794
required Offset position,
802
795
required BoxHitTest hitTest,
803
796
}) {
804
- assert (position != null );
805
- assert (hitTest != null );
806
797
final Offset transformedPosition = offset == null ? position : position - offset;
807
798
if (offset != null ) {
808
799
pushOffset (- offset);
@@ -838,9 +829,6 @@ class BoxHitTestResult extends HitTestResult {
838
829
required Offset position,
839
830
required BoxHitTest hitTest,
840
831
}) {
841
- assert (position != null );
842
- assert (hitTest != null );
843
- assert (position != null );
844
832
final Offset transformedPosition = transform == null ?
845
833
position : MatrixUtils .transformPoint (transform, position);
846
834
if (transform != null ) {
@@ -887,7 +875,6 @@ class BoxHitTestResult extends HitTestResult {
887
875
Matrix4 ? rawTransform,
888
876
required BoxHitTestWithOutOfBandPosition hitTest,
889
877
}) {
890
- assert (hitTest != null );
891
878
assert (
892
879
(paintOffset == null && paintTransform == null && rawTransform != null ) ||
893
880
(paintOffset == null && paintTransform != null && rawTransform == null ) ||
@@ -915,8 +902,7 @@ class BoxHitTestEntry extends HitTestEntry<RenderBox> {
915
902
/// Creates a box hit test entry.
916
903
///
917
904
/// The [localPosition] argument must not be null.
918
- BoxHitTestEntry (super .target, this .localPosition)
919
- : assert (localPosition != null );
905
+ BoxHitTestEntry (super .target, this .localPosition);
920
906
921
907
/// The position of the hit test in the local coordinates of [target] .
922
908
final Offset localPosition;
@@ -1452,13 +1438,6 @@ abstract class RenderBox extends RenderObject {
1452
1438
@mustCallSuper
1453
1439
double getMinIntrinsicWidth (double height) {
1454
1440
assert (() {
1455
- if (height == null ) {
1456
- throw FlutterError .fromParts (< DiagnosticsNode > [
1457
- ErrorSummary ('The height argument to getMinIntrinsicWidth was null.' ),
1458
- ErrorDescription ('The argument to getMinIntrinsicWidth must not be negative or null.' ),
1459
- ErrorHint ('If you do not have a specific height in mind, then pass double.infinity instead.' ),
1460
- ]);
1461
- }
1462
1441
if (height < 0.0 ) {
1463
1442
throw FlutterError .fromParts (< DiagnosticsNode > [
1464
1443
ErrorSummary ('The height argument to getMinIntrinsicWidth was negative.' ),
@@ -1601,13 +1580,6 @@ abstract class RenderBox extends RenderObject {
1601
1580
@mustCallSuper
1602
1581
double getMaxIntrinsicWidth (double height) {
1603
1582
assert (() {
1604
- if (height == null ) {
1605
- throw FlutterError .fromParts (< DiagnosticsNode > [
1606
- ErrorSummary ('The height argument to getMaxIntrinsicWidth was null.' ),
1607
- ErrorDescription ('The argument to getMaxIntrinsicWidth must not be negative or null.' ),
1608
- ErrorHint ('If you do not have a specific height in mind, then pass double.infinity instead.' ),
1609
- ]);
1610
- }
1611
1583
if (height < 0.0 ) {
1612
1584
throw FlutterError .fromParts (< DiagnosticsNode > [
1613
1585
ErrorSummary ('The height argument to getMaxIntrinsicWidth was negative.' ),
@@ -1684,13 +1656,6 @@ abstract class RenderBox extends RenderObject {
1684
1656
@mustCallSuper
1685
1657
double getMinIntrinsicHeight (double width) {
1686
1658
assert (() {
1687
- if (width == null ) {
1688
- throw FlutterError .fromParts (< DiagnosticsNode > [
1689
- ErrorSummary ('The width argument to getMinIntrinsicHeight was null.' ),
1690
- ErrorDescription ('The argument to getMinIntrinsicHeight must not be negative or null.' ),
1691
- ErrorHint ('If you do not have a specific width in mind, then pass double.infinity instead.' ),
1692
- ]);
1693
- }
1694
1659
if (width < 0.0 ) {
1695
1660
throw FlutterError .fromParts (< DiagnosticsNode > [
1696
1661
ErrorSummary ('The width argument to getMinIntrinsicHeight was negative.' ),
@@ -1766,13 +1731,6 @@ abstract class RenderBox extends RenderObject {
1766
1731
@mustCallSuper
1767
1732
double getMaxIntrinsicHeight (double width) {
1768
1733
assert (() {
1769
- if (width == null ) {
1770
- throw FlutterError .fromParts (< DiagnosticsNode > [
1771
- ErrorSummary ('The width argument to getMaxIntrinsicHeight was null.' ),
1772
- ErrorDescription ('The argument to getMaxIntrinsicHeight must not be negative or null.' ),
1773
- ErrorHint ('If you do not have a specific width in mind, then pass double.infinity instead.' ),
1774
- ]);
1775
- }
1776
1734
if (width < 0.0 ) {
1777
1735
throw FlutterError .fromParts (< DiagnosticsNode > [
1778
1736
ErrorSummary ('The width argument to getMaxIntrinsicHeight was negative.' ),
@@ -2253,7 +2211,6 @@ abstract class RenderBox extends RenderObject {
2253
2211
2254
2212
@override
2255
2213
void debugAssertDoesMeetConstraints () {
2256
- assert (constraints != null );
2257
2214
assert (() {
2258
2215
if (! hasSize) {
2259
2216
final DiagnosticsNode contract;
@@ -2582,7 +2539,6 @@ abstract class RenderBox extends RenderObject {
2582
2539
/// child's [parentData] in the [BoxParentData.offset] field.
2583
2540
@override
2584
2541
void applyPaintTransform (RenderObject child, Matrix4 transform) {
2585
- assert (child != null );
2586
2542
assert (child.parent == this );
2587
2543
assert (() {
2588
2544
if (child.parentData is ! BoxParentData ) {
0 commit comments