Make sure that a FloatingActionButton doesn't crash in 0x0 environment (#175272)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
FloatingActionButton widget.
This commit is contained in:
Ahmed Mohamed Sameh 2025-10-09 03:16:54 +03:00 committed by GitHub
parent c5228651d0
commit 1126dc3793
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1467,6 +1467,19 @@ void main() {
},
);
});
testWidgets('FloatingActionButton does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
floatingActionButton: Center(
child: SizedBox.shrink(child: FloatingActionButton(onPressed: () {})),
),
),
),
);
expect(tester.getSize(find.byType(FloatingActionButton)), Size.zero);
});
}
Offset _rightEdgeOfFab(WidgetTester tester) {