Unverified Commit 56726796 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Fixed a problem with the FAB position if a maximum width was set on the bottom...

Fixed a problem with the FAB position if a maximum width was set on the bottom sheet of a scaffold. (#82234)
parent a1fa62ad
......@@ -283,6 +283,7 @@ class _BottomSheetState extends State<BottomSheet> {
if (constraints != null) {
bottomSheet = Align(
alignment: Alignment.bottomCenter,
heightFactor: 1.0,
child: ConstrainedBox(
constraints: constraints,
child: bottomSheet,
......
......@@ -910,9 +910,10 @@ void main() {
constraints: BoxConstraints(maxWidth: 80),
),
),
home: const Scaffold(
body: Center(child: Text('body')),
bottomSheet: Text('BottomSheet'),
home: Scaffold(
body: const Center(child: Text('body')),
bottomSheet: const Text('BottomSheet'),
floatingActionButton: FloatingActionButton(onPressed: () {}, child: const Icon(Icons.add)),
),
));
expect(find.text('BottomSheet'), findsOneWidget);
......@@ -921,6 +922,12 @@ void main() {
tester.getRect(find.text('BottomSheet')),
const Rect.fromLTRB(360, 558, 440, 600),
);
// Ensure the FAB is overlapping the top of the sheet
expect(find.byIcon(Icons.add), findsOneWidget);
expect(
tester.getRect(find.byIcon(Icons.add)),
const Rect.fromLTRB(744, 544, 768, 568),
);
});
testWidgets('Theme constraints used for showBottomSheet', (WidgetTester tester) async {
......
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