This commit is contained in:
1 parent
7509cf2ecd
commit
2f4593a46e
3 files changed
+74
-11
No files matched your search
@@ -210,4 +210,62 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byIcon(Icons.theaters_outlined), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_not_overflow_when_text_scale_is_two_on_narrow_screen', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(320, 640);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: MediaQuery(
|
||||
data: const MediaQueryData(textScaler: TextScaler.linear(2)),
|
||||
child: Scaffold(
|
||||
bottomNavigationBar: AppBottomNav(
|
||||
items: [
|
||||
AppBottomNavItem(
|
||||
tabKey: const Key('large-home'),
|
||||
icon: Icons.home_outlined,
|
||||
selectedIcon: Icons.home_rounded,
|
||||
label: 'Home',
|
||||
selected: true,
|
||||
onTap: () {},
|
||||
),
|
||||
AppBottomNavItem(
|
||||
tabKey: const Key('large-recommend'),
|
||||
icon: Icons.celebration_outlined,
|
||||
selectedIcon: Icons.celebration_rounded,
|
||||
label: 'Recommend',
|
||||
onTap: () {},
|
||||
),
|
||||
AppBottomNavItem(
|
||||
tabKey: const Key('large-following'),
|
||||
icon: Icons.bookmark_border_rounded,
|
||||
selectedIcon: Icons.bookmark_rounded,
|
||||
label: 'Following',
|
||||
onTap: () {},
|
||||
),
|
||||
AppBottomNavItem(
|
||||
tabKey: const Key('large-mine'),
|
||||
icon: Icons.person_outline_rounded,
|
||||
selectedIcon: Icons.person_rounded,
|
||||
label: 'My',
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('large-recommend'))).height,
|
||||
greaterThanOrEqualTo(AppDimens.tapTarget),
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user