mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a NavigationRail doesn't crash in 0x0 environment (#177022)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the NavigationRail widget.
This commit is contained in:
parent
4f7d2652c5
commit
fd2b1bc720
@ -6127,6 +6127,24 @@ void main() {
|
||||
expect(updatedWidthRTL, defaultWidth + safeAreaPadding);
|
||||
});
|
||||
}); // End Material 2 group
|
||||
|
||||
testWidgets('NavigationRail does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: NavigationRail(
|
||||
destinations: const <NavigationRailDestination>[
|
||||
NavigationRailDestination(icon: Icon(Icons.abc), label: Text('X')),
|
||||
],
|
||||
selectedIndex: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(NavigationRail)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
TestSemantics _expectedSemantics({bool scrollable = false}) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user