mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
SnackBarBehavior.floating offset fix by default (#54985)
This commit is contained in:
parent
54cdc26afb
commit
6ce90a936f
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue