mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
c5228651d0
commit
1126dc3793
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user