Unverified Commit 6ce90a93 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

SnackBarBehavior.floating offset fix by default (#54985)

parent 54cdc26a
...@@ -1343,7 +1343,7 @@ class Scaffold extends StatefulWidget { ...@@ -1343,7 +1343,7 @@ class Scaffold extends StatefulWidget {
'eventually be removed. ' 'eventually be removed. '
'This feature was deprecated after v1.15.3.' '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. /// The state from the closest instance of this class that encloses the given context.
/// ///
......
...@@ -1075,10 +1075,6 @@ void main() { ...@@ -1075,10 +1075,6 @@ void main() {
'$behavior should align SnackBar with the bottom of Scaffold ' '$behavior should align SnackBar with the bottom of Scaffold '
'when Scaffold has no other elements', 'when Scaffold has no other elements',
(WidgetTester tester) async { (WidgetTester tester) async {
// TODO(shihaohong): Remove this flag once the migration to fix
// SnackBarBehavior.floating is complete.
Scaffold.shouldSnackBarIgnoreFABRect = true;
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
home: Scaffold( home: Scaffold(
...@@ -1101,9 +1097,6 @@ void main() { ...@@ -1101,9 +1097,6 @@ void main() {
final Offset scaffoldBottomLeft = tester.getBottomLeft(find.byType(Scaffold)); final Offset scaffoldBottomLeft = tester.getBottomLeft(find.byType(Scaffold));
expect(snackBarBottomLeft, equals(scaffoldBottomLeft)); 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() { ...@@ -1111,9 +1104,6 @@ void main() {
'$behavior should align SnackBar with the top of BottomNavigationBar ' '$behavior should align SnackBar with the top of BottomNavigationBar '
'when Scaffold has no FloatingActionButton', 'when Scaffold has no FloatingActionButton',
(WidgetTester tester) async { (WidgetTester tester) async {
// TODO(shihaohong): Remove this flag once the migration to fix
// SnackBarBehavior.floating is complete.
Scaffold.shouldSnackBarIgnoreFABRect = true;
final UniqueKey boxKey = UniqueKey(); final UniqueKey boxKey = UniqueKey();
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
...@@ -1138,9 +1128,6 @@ void main() { ...@@ -1138,9 +1128,6 @@ void main() {
final Offset bottomNavigationBarTopLeft = tester.getTopLeft(find.byKey(boxKey)); final Offset bottomNavigationBarTopLeft = tester.getTopLeft(find.byKey(boxKey));
expect(snackBarBottomLeft, equals(bottomNavigationBarTopLeft)); expect(snackBarBottomLeft, equals(bottomNavigationBarTopLeft));
// TODO(shihaohong): Remove this flag once the migration to fix
// SnackBarBehavior.floating is complete.
Scaffold.shouldSnackBarIgnoreFABRect = false;
}, },
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment