Skip to content

Commit 9c4b492

Browse files
committed
fix: navbar responsiveness
1 parent a3381c9 commit 9c4b492

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

lib/screens/mobile/navbar.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class NavRail extends ConsumerWidget {
124124
Icons.help,
125125
Icons.help_outline,
126126
'About',
127+
showLabel: false,
127128
),
128129
const SizedBox(height: 24),
129130
customNavigationDestination(
@@ -134,6 +135,7 @@ class NavRail extends ConsumerWidget {
134135
Icons.settings,
135136
Icons.settings_outlined,
136137
'Settings',
138+
showLabel: false,
137139
),
138140
],
139141
),

lib/screens/mobile/widgets/page_base.dart

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_riverpod/flutter_riverpod.dart';
33
import 'package:apidash/consts.dart';
4+
import 'package:apidash/extensions/extensions.dart';
45
import 'package:apidash/providers/providers.dart';
56
import 'package:apidash/widgets/window_caption.dart';
7+
import '../navbar.dart';
68

79
class PageBase extends ConsumerWidget {
810
final String title;
@@ -13,27 +15,39 @@ class PageBase extends ConsumerWidget {
1315
Widget build(BuildContext context, WidgetRef ref) {
1416
final isDarkMode =
1517
ref.watch(settingsProvider.select((value) => value.isDark));
18+
final scaffold = Scaffold(
19+
backgroundColor: Theme.of(context).colorScheme.background,
20+
appBar: AppBar(
21+
backgroundColor: Theme.of(context).colorScheme.background,
22+
primary: true,
23+
title: Text(title),
24+
centerTitle: true,
25+
),
26+
body: Padding(
27+
padding: EdgeInsets.only(
28+
bottom: MediaQuery.paddingOf(context).bottom,
29+
),
30+
child: scaffoldBody,
31+
),
32+
);
1633
return Stack(
1734
children: [
1835
Container(
19-
padding: const EdgeInsets.only(bottom: 70) +
36+
padding: (context.isCompactWindow
37+
? const EdgeInsets.only(bottom: 70)
38+
: EdgeInsets.zero) +
2039
(kIsWindows || kIsMacOS ? kPt28 : EdgeInsets.zero),
2140
color: Theme.of(context).colorScheme.surface,
22-
child: Scaffold(
23-
backgroundColor: Theme.of(context).colorScheme.background,
24-
appBar: AppBar(
25-
backgroundColor: Theme.of(context).colorScheme.background,
26-
primary: true,
27-
title: Text(title),
28-
centerTitle: true,
29-
),
30-
body: Padding(
31-
padding: EdgeInsets.only(
32-
bottom: MediaQuery.paddingOf(context).bottom,
33-
),
34-
child: scaffoldBody,
35-
),
36-
),
41+
child: !context.isCompactWindow
42+
? Row(
43+
children: [
44+
const NavRail(),
45+
Expanded(
46+
child: scaffold,
47+
),
48+
],
49+
)
50+
: scaffold,
3751
),
3852
if (kIsWindows)
3953
SizedBox(

0 commit comments

Comments
 (0)