SnackBarBehavior.floating offset fix by default (#54985)

This commit is contained in:
Shi-Hao Hong
2020-04-16 14:50:01 -07:00
committed by GitHub
parent 54cdc26afb
commit 6ce90a936f
2 changed files with 1 additions and 14 deletions

View File

@@ -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.
///

View File

@@ -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;
},
);