mirror of
https://github.com/flutter/flutter.git
synced 2026-02-13 22:31:34 +08:00
Make sure that a MaterialBanner doesn't crash in 0x0 environment (#172074)
This is my attempt to handle #6537 for the MaterialBanner UI control.
This commit is contained in:
parent
28f63a398d
commit
c2106147e2
@ -1207,6 +1207,20 @@ void main() {
|
||||
final Size materialBarSize = tester.getSize(find.byType(MaterialBanner));
|
||||
expect(materialBarSize.height, equals(minActionBarHeight));
|
||||
});
|
||||
|
||||
testWidgets('MaterialBanner renders at zero size', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: MaterialBanner(content: Text('X'), actions: <Widget>[SizedBox.shrink()]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
final Finder content = find.text('X');
|
||||
expect(tester.getSize(content).isEmpty, isTrue);
|
||||
});
|
||||
}
|
||||
|
||||
Material _getMaterialFromBanner(WidgetTester tester) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user