@@ -52,8 +52,7 @@ class AnimatedList extends _AnimatedScrollView {
5252 super .shrinkWrap = false ,
5353 super .padding,
5454 super .clipBehavior = Clip .hardEdge,
55- }) : assert (itemBuilder != null ),
56- assert (initialItemCount != null && initialItemCount >= 0 );
55+ }) : assert (initialItemCount >= 0 );
5756
5857 /// The state from the closest instance of this class that encloses the given
5958 /// context.
@@ -74,7 +73,6 @@ class AnimatedList extends _AnimatedScrollView {
7473 /// * [maybeOf] , a similar function that will return null if no
7574 /// [AnimatedList] ancestor is found.
7675 static AnimatedListState of (BuildContext context) {
77- assert (context != null );
7876 final AnimatedListState ? result = AnimatedList .maybeOf (context);
7977 assert (() {
8078 if (result == null ) {
@@ -116,7 +114,6 @@ class AnimatedList extends _AnimatedScrollView {
116114 /// * [of] , a similar function that will throw if no [AnimatedList] ancestor
117115 /// is found.
118116 static AnimatedListState ? maybeOf (BuildContext context) {
119- assert (context != null );
120117 return context.findAncestorStateOfType <AnimatedListState >();
121118 }
122119
@@ -217,8 +214,7 @@ class AnimatedGrid extends _AnimatedScrollView {
217214 super .physics,
218215 super .padding,
219216 super .clipBehavior = Clip .hardEdge,
220- }) : assert (itemBuilder != null ),
221- assert (initialItemCount != null && initialItemCount >= 0 );
217+ }) : assert (initialItemCount >= 0 );
222218
223219 /// {@template flutter.widgets.AnimatedGrid.gridDelegate}
224220 /// A delegate that controls the layout of the children within the
@@ -252,7 +248,6 @@ class AnimatedGrid extends _AnimatedScrollView {
252248 /// * [maybeOf] , a similar function that will return null if no
253249 /// [AnimatedGrid] ancestor is found.
254250 static AnimatedGridState of (BuildContext context) {
255- assert (context != null );
256251 final AnimatedGridState ? result = AnimatedGrid .maybeOf (context);
257252 assert (() {
258253 if (result == null ) {
@@ -294,7 +289,6 @@ class AnimatedGrid extends _AnimatedScrollView {
294289 /// * [of] , a similar function that will throw if no [AnimatedGrid] ancestor
295290 /// is found.
296291 static AnimatedGridState ? maybeOf (BuildContext context) {
297- assert (context != null );
298292 return context.findAncestorStateOfType <AnimatedGridState >();
299293 }
300294
@@ -373,8 +367,7 @@ abstract class _AnimatedScrollView extends StatefulWidget {
373367 this .shrinkWrap = false ,
374368 this .padding,
375369 this .clipBehavior = Clip .hardEdge,
376- }) : assert (itemBuilder != null ),
377- assert (initialItemCount != null && initialItemCount >= 0 );
370+ }) : assert (initialItemCount >= 0 );
378371
379372 /// {@template flutter.widgets.AnimatedScrollView.itemBuilder}
380373 /// Called, as needed, to build children widgets.
@@ -630,8 +623,7 @@ class SliverAnimatedList extends _SliverAnimatedMultiBoxAdaptor {
630623 required super .itemBuilder,
631624 super .findChildIndexCallback,
632625 super .initialItemCount = 0 ,
633- }) : assert (itemBuilder != null ),
634- assert (initialItemCount != null && initialItemCount >= 0 );
626+ }) : assert (initialItemCount >= 0 );
635627
636628 @override
637629 SliverAnimatedListState createState () => SliverAnimatedListState ();
@@ -655,7 +647,6 @@ class SliverAnimatedList extends _SliverAnimatedMultiBoxAdaptor {
655647 /// * [maybeOf] , a similar function that will return null if no
656648 /// [SliverAnimatedList] ancestor is found.
657649 static SliverAnimatedListState of (BuildContext context) {
658- assert (context != null );
659650 final SliverAnimatedListState ? result = SliverAnimatedList .maybeOf (context);
660651 assert (() {
661652 if (result == null ) {
@@ -695,7 +686,6 @@ class SliverAnimatedList extends _SliverAnimatedMultiBoxAdaptor {
695686 /// * [of] , a similar function that will throw if no [SliverAnimatedList]
696687 /// ancestor is found.
697688 static SliverAnimatedListState ? maybeOf (BuildContext context) {
698- assert (context != null );
699689 return context.findAncestorStateOfType <SliverAnimatedListState >();
700690 }
701691}
@@ -782,8 +772,7 @@ class SliverAnimatedGrid extends _SliverAnimatedMultiBoxAdaptor {
782772 required this .gridDelegate,
783773 super .findChildIndexCallback,
784774 super .initialItemCount = 0 ,
785- }) : assert (itemBuilder != null ),
786- assert (initialItemCount != null && initialItemCount >= 0 );
775+ }) : assert (initialItemCount >= 0 );
787776
788777 @override
789778 SliverAnimatedGridState createState () => SliverAnimatedGridState ();
@@ -807,7 +796,6 @@ class SliverAnimatedGrid extends _SliverAnimatedMultiBoxAdaptor {
807796 /// * [maybeOf] , a similar function that will return null if no
808797 /// [SliverAnimatedGrid] ancestor is found.
809798 static SliverAnimatedGridState of (BuildContext context) {
810- assert (context != null );
811799 final SliverAnimatedGridState ? result = context.findAncestorStateOfType <SliverAnimatedGridState >();
812800 assert (() {
813801 if (result == null ) {
@@ -844,7 +832,6 @@ class SliverAnimatedGrid extends _SliverAnimatedMultiBoxAdaptor {
844832 /// * [of] , a similar function that will throw if no [SliverAnimatedGrid]
845833 /// ancestor is found.
846834 static SliverAnimatedGridState ? maybeOf (BuildContext context) {
847- assert (context != null );
848835 return context.findAncestorStateOfType <SliverAnimatedGridState >();
849836 }
850837}
@@ -908,8 +895,7 @@ abstract class _SliverAnimatedMultiBoxAdaptor extends StatefulWidget {
908895 required this .itemBuilder,
909896 this .findChildIndexCallback,
910897 this .initialItemCount = 0 ,
911- }) : assert (itemBuilder != null ),
912- assert (initialItemCount != null && initialItemCount >= 0 );
898+ }) : assert (initialItemCount >= 0 );
913899
914900 /// {@macro flutter.widgets.AnimatedScrollView.itemBuilder}
915901 final AnimatedItemBuilder itemBuilder;
@@ -1022,8 +1008,7 @@ abstract class _SliverAnimatedMultiBoxAdaptorState<T extends _SliverAnimatedMult
10221008 /// increases the length of the list of items by one and shifts
10231009 /// all items at or after [index] towards the end of the list of items.
10241010 void insertItem (int index, { Duration duration = _kDuration }) {
1025- assert (index != null && index >= 0 );
1026- assert (duration != null );
1011+ assert (index >= 0 );
10271012
10281013 final int itemIndex = _indexToItemIndex (index);
10291014 assert (itemIndex >= 0 && itemIndex <= _itemsCount);
@@ -1074,9 +1059,7 @@ abstract class _SliverAnimatedMultiBoxAdaptorState<T extends _SliverAnimatedMult
10741059 /// decreases the length of items by one and shifts
10751060 /// all items at or before [index] towards the beginning of the list of items.
10761061 void removeItem (int index, AnimatedRemovedItemBuilder builder, { Duration duration = _kDuration }) {
1077- assert (index != null && index >= 0 );
1078- assert (builder != null );
1079- assert (duration != null );
1062+ assert (index >= 0 );
10801063
10811064 final int itemIndex = _indexToItemIndex (index);
10821065 assert (itemIndex >= 0 && itemIndex < _itemsCount);
0 commit comments