Skip to content

Commit 586c667

Browse files
home: Replace SizeBox with ConstrainedBox in bottom nav bar
This allows the height of bottom nav bar to dyanmically change on the basis of system font size, maxHeight has been set after calibration.
1 parent 22e7f3d commit 586c667

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

lib/widgets/home.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,15 @@ class _HomePageState extends State<HomePage> {
142142
border: Border(top: BorderSide(color: designVariables.borderBar)),
143143
color: designVariables.bgBotBar),
144144
child: SafeArea(
145-
child: SizedBox(height: 48,
146-
child: Center(
147-
child: ConstrainedBox(
148-
// TODO(design): determine a suitable max width for bottom nav bar
149-
constraints: const BoxConstraints(maxWidth: 600),
150-
child: Row(
151-
crossAxisAlignment: CrossAxisAlignment.stretch,
152-
children: [
153-
for (final navigationBarButton in navigationBarButtons)
154-
Expanded(child: navigationBarButton),
155-
])))))));
145+
child: ConstrainedBox(
146+
// TODO(design): determine a suitable max width for bottom nav bar
147+
constraints: const BoxConstraints(maxWidth: 600, minHeight: 48, maxHeight: 85),
148+
child: Row(
149+
crossAxisAlignment: CrossAxisAlignment.start,
150+
children: [
151+
for (final navigationBarButton in navigationBarButtons)
152+
Expanded(child: navigationBarButton),
153+
])))));
156154
}
157155
}
158156

test/widgets/recent_dm_conversations_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Future<void> setupPage(WidgetTester tester, {
5858

5959
// Switch to direct messages tab.
6060
await tester.tap(find.descendant(
61-
of: find.byType(Center),
61+
of: find.byType(DecoratedBox),
6262
matching: find.byIcon(ZulipIcons.two_person)));
6363
await tester.pump();
6464
}

0 commit comments

Comments
 (0)