From 6ce90a936f79ec3bda93c0997d3b5317dd841dbf Mon Sep 17 00:00:00 2001 From: Shi-Hao Hong Date: Thu, 16 Apr 2020 14:50:01 -0700 Subject: [PATCH] SnackBarBehavior.floating offset fix by default (#54985) --- packages/flutter/lib/src/material/scaffold.dart | 2 +- packages/flutter/test/material/snack_bar_test.dart | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 17c061bc54..7bf184fe3a 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -1343,7 +1343,7 @@ class Scaffold extends StatefulWidget { 'eventually be removed. ' 'This feature was deprecated after v1.15.3.' ) - static bool shouldSnackBarIgnoreFABRect = false; + static bool shouldSnackBarIgnoreFABRect = true; /// The state from the closest instance of this class that encloses the given context. /// diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index 0b5d299d3a..67b7b27c01 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -1075,10 +1075,6 @@ void main() { '$behavior should align SnackBar with the bottom of Scaffold ' 'when Scaffold has no other elements', (WidgetTester tester) async { - // TODO(shihaohong): Remove this flag once the migration to fix - // SnackBarBehavior.floating is complete. - Scaffold.shouldSnackBarIgnoreFABRect = true; - await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1101,9 +1097,6 @@ void main() { final Offset scaffoldBottomLeft = tester.getBottomLeft(find.byType(Scaffold)); expect(snackBarBottomLeft, equals(scaffoldBottomLeft)); - // TODO(shihaohong): Remove this flag once the migration to fix - // SnackBarBehavior.floating is complete. - Scaffold.shouldSnackBarIgnoreFABRect = false; }, ); @@ -1111,9 +1104,6 @@ void main() { '$behavior should align SnackBar with the top of BottomNavigationBar ' 'when Scaffold has no FloatingActionButton', (WidgetTester tester) async { - // TODO(shihaohong): Remove this flag once the migration to fix - // SnackBarBehavior.floating is complete. - Scaffold.shouldSnackBarIgnoreFABRect = true; final UniqueKey boxKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1138,9 +1128,6 @@ void main() { final Offset bottomNavigationBarTopLeft = tester.getTopLeft(find.byKey(boxKey)); expect(snackBarBottomLeft, equals(bottomNavigationBarTopLeft)); - // TODO(shihaohong): Remove this flag once the migration to fix - // SnackBarBehavior.floating is complete. - Scaffold.shouldSnackBarIgnoreFABRect = false; }, );