Skip to content

Commit 962bf0f

Browse files
committed
Update dashboard.dart
1 parent 1ba6a3f commit 962bf0f

File tree

1 file changed

+101
-103
lines changed

1 file changed

+101
-103
lines changed

lib/screens/dashboard.dart

Lines changed: 101 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -20,126 +20,124 @@ class Dashboard extends ConsumerWidget {
2020
final settings = ref.watch(settingsProvider);
2121
return Scaffold(
2222
body: SafeArea(
23-
child: Stack(
24-
children: [
25-
Row(
26-
children: <Widget>[
23+
child: Row(
24+
children: <Widget>[
25+
Column(
26+
children: [
27+
SizedBox(
28+
height: kIsMacOS ? 32.0 : 16.0,
29+
width: 64,
30+
),
2731
Column(
32+
mainAxisSize: MainAxisSize.min,
2833
children: [
29-
SizedBox(
30-
height: kIsMacOS ? 32.0 : 16.0,
31-
width: 64,
34+
IconButton(
35+
isSelected: railIdx == 0,
36+
onPressed: () {
37+
ref.read(navRailIndexStateProvider.notifier).state = 0;
38+
},
39+
icon: const Icon(Icons.auto_awesome_mosaic_outlined),
40+
selectedIcon: const Icon(Icons.auto_awesome_mosaic),
3241
),
33-
Column(
34-
mainAxisSize: MainAxisSize.min,
35-
children: [
36-
IconButton(
37-
isSelected: railIdx == 0,
38-
onPressed: () {
39-
ref.read(navRailIndexStateProvider.notifier).state = 0;
40-
},
41-
icon: const Icon(Icons.auto_awesome_mosaic_outlined),
42-
selectedIcon: const Icon(Icons.auto_awesome_mosaic),
43-
),
44-
Text(
45-
'Requests',
46-
style: Theme.of(context).textTheme.labelSmall,
47-
),
48-
kVSpacer10,
49-
IconButton(
50-
isSelected: railIdx == 1,
51-
onPressed: () {
52-
ref.read(navRailIndexStateProvider.notifier).state = 1;
53-
},
54-
icon: const Icon(Icons.laptop_windows_outlined),
55-
selectedIcon: const Icon(Icons.laptop_windows),
56-
),
57-
Text(
58-
'Variables',
59-
style: Theme.of(context).textTheme.labelSmall,
60-
),
61-
kVSpacer10,
62-
IconButton(
63-
isSelected: railIdx == 2,
64-
onPressed: () {
65-
ref.read(navRailIndexStateProvider.notifier).state = 2;
66-
},
67-
icon: const Icon(Icons.history_outlined),
68-
selectedIcon: const Icon(Icons.history_rounded),
69-
),
70-
Text(
71-
'History',
72-
style: Theme.of(context).textTheme.labelSmall,
73-
),
74-
],
42+
Text(
43+
'Requests',
44+
style: Theme.of(context).textTheme.labelSmall,
7545
),
76-
Expanded(
77-
child: Column(
78-
mainAxisAlignment: MainAxisAlignment.end,
79-
children: [
80-
Padding(
81-
padding: const EdgeInsets.only(bottom: 16.0),
82-
child: NavbarButton(
83-
railIdx: railIdx,
84-
selectedIcon: Icons.help,
85-
icon: Icons.help_outline,
86-
label: 'About',
87-
showLabel: false,
88-
isCompact: true,
89-
onTap: () {
90-
showAboutAppDialog(context);
91-
},
92-
),
93-
),
94-
Padding(
95-
padding: const EdgeInsets.only(bottom: 16.0),
96-
child: NavbarButton(
97-
railIdx: railIdx,
98-
buttonIdx: 3,
99-
selectedIcon: Icons.settings,
100-
icon: Icons.settings_outlined,
101-
label: 'Settings',
102-
showLabel: false,
103-
isCompact: true,
104-
),
105-
),
106-
],
107-
),
46+
kVSpacer10,
47+
IconButton(
48+
isSelected: railIdx == 1,
49+
onPressed: () {
50+
ref.read(navRailIndexStateProvider.notifier).state = 1;
51+
},
52+
icon: const Icon(Icons.laptop_windows_outlined),
53+
selectedIcon: const Icon(Icons.laptop_windows),
54+
),
55+
Text(
56+
'Variables',
57+
style: Theme.of(context).textTheme.labelSmall,
58+
),
59+
kVSpacer10,
60+
IconButton(
61+
isSelected: railIdx == 2,
62+
onPressed: () {
63+
ref.read(navRailIndexStateProvider.notifier).state = 2;
64+
},
65+
icon: const Icon(Icons.history_outlined),
66+
selectedIcon: const Icon(Icons.history_rounded),
67+
),
68+
Text(
69+
'History',
70+
style: Theme.of(context).textTheme.labelSmall,
10871
),
10972
],
11073
),
111-
VerticalDivider(
112-
thickness: 1,
113-
width: 1,
114-
color: Theme.of(context).colorScheme.surfaceContainerHigh,
115-
),
11674
Expanded(
117-
child: IndexedStack(
118-
alignment: AlignmentDirectional.topCenter,
119-
index: railIdx,
120-
children: const [
121-
HomePage(),
122-
EnvironmentPage(),
123-
HistoryPage(),
124-
SettingsPage(),
75+
child: Column(
76+
mainAxisAlignment: MainAxisAlignment.end,
77+
children: [
78+
Padding(
79+
padding: const EdgeInsets.only(bottom: 16.0),
80+
child: NavbarButton(
81+
railIdx: railIdx,
82+
selectedIcon: Icons.help,
83+
icon: Icons.help_outline,
84+
label: 'About',
85+
showLabel: false,
86+
isCompact: true,
87+
onTap: () {
88+
showAboutAppDialog(context);
89+
},
90+
),
91+
),
92+
Padding(
93+
padding: const EdgeInsets.only(bottom: 16.0),
94+
child: NavbarButton(
95+
railIdx: railIdx,
96+
buttonIdx: 3,
97+
selectedIcon: Icons.settings,
98+
icon: Icons.settings_outlined,
99+
label: 'Settings',
100+
showLabel: false,
101+
isCompact: true,
102+
),
103+
),
125104
],
126105
),
127-
)
106+
),
128107
],
129108
),
130-
131-
// DashBot Overlay
132-
if (isDashBotVisible)
133-
Positioned(
134-
bottom: 20,
135-
right: 20,
136-
child: const DashBotOverlay(),
109+
VerticalDivider(
110+
thickness: 1,
111+
width: 1,
112+
color: Theme.of(context).colorScheme.surfaceContainerHigh,
113+
),
114+
Expanded(
115+
child: IndexedStack(
116+
alignment: AlignmentDirectional.topCenter,
117+
index: railIdx,
118+
children: const [
119+
HomePage(),
120+
EnvironmentPage(),
121+
HistoryPage(),
122+
SettingsPage(),
123+
],
137124
),
125+
)
138126
],
139127
),
140128
),
141129
floatingActionButton: settings.isDashBotEnabled
142-
? const DashBotFAB()
130+
? FloatingActionButton(
131+
onPressed: () => showModalBottomSheet(
132+
context: context,
133+
isScrollControlled: true,
134+
builder: (context) => const Padding(
135+
padding: EdgeInsets.all(16.0),
136+
child: DashBotWidget(),
137+
),
138+
),
139+
child: const Icon(Icons.help_outline),
140+
)
143141
: null,
144142
);
145143
}

0 commit comments

Comments
 (0)