constStringmessage='Floating SnackBar presented off screen.\n'
'A SnackBar with behavior property set to SnackBarBehavior.floating is fully '
'or partially off screen because some or all the widgets provided to '
'Scaffold.floatingActionButton, Scaffold.persistentFooterButtons and '
'Scaffold.bottomNavigationBar take up too much vertical space.\n'
'Consider constraining the size of these widgets to allow room for the SnackBar to be visible.';
expect(exception.message,message);
}
testWidgets('Snackbar with SnackBarBehavior.floating will assert when offsetted too high by a large Scaffold.floatingActionButton',(WidgetTestertester)async{
// Regression test for https://github.com/flutter/flutter/issues/84263
awaittester.pumpWidget(
MaterialApp(
home:Scaffold(
floatingActionButton:Container(),
),
),
);
openFloatingSnackBar(tester);
awaittester.pumpAndSettle();// Have the SnackBar fully animate out.
expectSnackBarNotVisibleError(tester);
});
testWidgets('Snackbar with SnackBarBehavior.floating will assert when offsetted too high by a large Scaffold.persistentFooterButtons',(WidgetTestertester)async{
// Regression test for https://github.com/flutter/flutter/issues/84263
awaittester.pumpAndSettle();// Have the SnackBar fully animate out.
expectSnackBarNotVisibleError(tester);
});
testWidgets('Snackbar with SnackBarBehavior.floating will assert when offsetted too high by a large Scaffold.bottomNavigationBar',(WidgetTestertester)async{
// Regression test for https://github.com/flutter/flutter/issues/84263
awaittester.pumpWidget(
constMaterialApp(
home:Scaffold(
bottomNavigationBar:SizedBox(height:1000),
),
),
);
openFloatingSnackBar(tester);
awaittester.pumpAndSettle();// Have the SnackBar fully animate out.
expectSnackBarNotVisibleError(tester);
});
testWidgets(
'SnackBar has correct end padding when it contains an action with fixed behavior',