File tree Expand file tree Collapse file tree 2 files changed +2
-53
lines changed Expand file tree Collapse file tree 2 files changed +2
-53
lines changed Original file line number Diff line number Diff line change @@ -348,8 +348,7 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate {
348348 }) : assert (crossAxisCount > 0 ),
349349 assert (mainAxisSpacing >= 0 ),
350350 assert (crossAxisSpacing >= 0 ),
351- assert (childAspectRatio > 0 ),
352- assert (mainAxisExtent == null || mainAxisExtent >= 0 );
351+ assert (childAspectRatio > 0 );
353352
354353 /// The number of children in the cross axis.
355354 final int crossAxisCount;
@@ -447,8 +446,7 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate {
447446 }) : assert (maxCrossAxisExtent > 0 ),
448447 assert (mainAxisSpacing >= 0 ),
449448 assert (crossAxisSpacing >= 0 ),
450- assert (childAspectRatio > 0 ),
451- assert (mainAxisExtent == null || mainAxisExtent >= 0 );
449+ assert (childAspectRatio > 0 );
452450
453451 /// The maximum extent of tiles in the cross axis.
454452 ///
Original file line number Diff line number Diff line change @@ -898,53 +898,4 @@ void main() {
898898 expect (controller.position.maxScrollExtent, 472.0 );
899899 expect (controller.position.pixels, 472.0 );
900900 });
901-
902- testWidgets ('SliverGridDelegate mainAxisExtent add assert' , (WidgetTester tester) async {
903- Widget buildGridView (SliverGridDelegate delegate) {
904- return Directionality (
905- textDirection: TextDirection .ltr,
906- child: GridView .builder (
907- gridDelegate: delegate,
908- itemBuilder: (BuildContext context, int index) {
909- return Container (
910- height: 50 ,
911- alignment: Alignment .center,
912- child: Text ('$index ' ),
913- );
914- },
915- itemCount: 50 ,
916- ),
917- );
918- }
919-
920- expect (
921- () => tester.pumpWidget (buildGridView (SliverGridDelegateWithFixedCrossAxisCount (
922- crossAxisCount: 3 ,
923- mainAxisSpacing: 8 ,
924- crossAxisSpacing: 8 ,
925- mainAxisExtent: - 100 ,
926- ))),
927- throwsA (isAssertionError.having (
928- (AssertionError e) => e.toString (),
929- '.toString()' ,
930- contains ("'mainAxisExtent == null || mainAxisExtent >= 0': is not true." ),
931- )),
932- );
933-
934- expect (
935- () => tester.pumpWidget (buildGridView (SliverGridDelegateWithMaxCrossAxisExtent (
936- maxCrossAxisExtent: 100 ,
937- mainAxisSpacing: 8 ,
938- crossAxisSpacing: 8 ,
939- mainAxisExtent: - 100 ,
940- ))),
941- throwsA (isAssertionError.having (
942- (AssertionError e) => e.toString (),
943- '.toString()' ,
944- contains ("'mainAxisExtent == null || mainAxisExtent >= 0': is not true." ),
945- )),
946- );
947- });
948-
949-
950901}
You can’t perform that action at this time.
0 commit comments