Skip to content

Commit d75f22f

Browse files
committed
revert: drawer because navigationdrawer has issues
1 parent fbebf75 commit d75f22f

File tree

1 file changed

+166
-164
lines changed

1 file changed

+166
-164
lines changed

lib/helpers/drawer.dart

Lines changed: 166 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -38,179 +38,181 @@ class MainDrawer extends StatelessWidget {
3838
String championship = Hive.box('settings')
3939
.get('championship', defaultValue: 'Formula 1') as String;
4040

41-
return NavigationDrawer(
42-
children: [
43-
DrawerHeader(
44-
decoration: BoxDecoration(
45-
color: Theme.of(context).colorScheme.onPrimary,
46-
),
47-
child: const Center(
48-
child: Text(
49-
'Box, Box!',
50-
style: TextStyle(
51-
fontSize: 28,
52-
fontWeight: FontWeight.w700,
53-
),
41+
return Drawer(
42+
child: Column(
43+
children: [
44+
DrawerHeader(
45+
decoration: BoxDecoration(
46+
color: Theme.of(context).colorScheme.onPrimary,
5447
),
55-
),
56-
),
57-
championship == 'Formula 1'
58-
? ListTile(
59-
title: Text(
60-
'Formula You',
61-
),
62-
leading: Icon(
63-
Icons.account_circle_outlined,
48+
child: const Center(
49+
child: Text(
50+
'Box, Box!',
51+
style: TextStyle(
52+
fontSize: 28,
53+
fontWeight: FontWeight.w700,
6454
),
65-
onTap: () {
66-
context.pop();
67-
context.pushNamed('formula-you');
68-
},
69-
)
70-
: Container(),
71-
ListTile(
72-
title: Text(
73-
AppLocalizations.of(context)!.newsMix,
55+
),
56+
),
7457
),
75-
leading: Icon(
76-
Icons.dynamic_feed_outlined,
58+
championship == 'Formula 1'
59+
? ListTile(
60+
title: Text(
61+
'Formula You',
62+
),
63+
leading: Icon(
64+
Icons.account_circle_outlined,
65+
),
66+
onTap: () {
67+
context.pop();
68+
context.pushNamed('formula-you');
69+
},
70+
)
71+
: Container(),
72+
ListTile(
73+
title: Text(
74+
AppLocalizations.of(context)!.newsMix,
75+
),
76+
leading: Icon(
77+
Icons.dynamic_feed_outlined,
78+
),
79+
onTap: () {
80+
context.pop();
81+
context.pushNamed('mixed-news');
82+
},
7783
),
78-
onTap: () {
79-
context.pop();
80-
context.pushNamed('mixed-news');
81-
},
82-
),
83-
championship == 'Formula 1'
84-
? ListTile(
85-
title: Text(
86-
AppLocalizations.of(context)!.hallOfFame,
87-
),
88-
leading: Icon(
89-
Icons.emoji_events_outlined,
90-
),
91-
onTap: () {
92-
context.pop();
93-
context.pushNamed('hall-of-fame');
94-
},
95-
)
96-
: Container(),
97-
ListTile(
98-
title: Text(
99-
AppLocalizations.of(context)!.history,
84+
championship == 'Formula 1'
85+
? ListTile(
86+
title: Text(
87+
AppLocalizations.of(context)!.hallOfFame,
88+
),
89+
leading: Icon(
90+
Icons.emoji_events_outlined,
91+
),
92+
onTap: () {
93+
context.pop();
94+
context.pushNamed('hall-of-fame');
95+
},
96+
)
97+
: Container(),
98+
ListTile(
99+
title: Text(
100+
AppLocalizations.of(context)!.history,
101+
),
102+
leading: Icon(
103+
Icons.history_outlined,
104+
),
105+
onTap: () {
106+
context.pop();
107+
context.pushNamed('history');
108+
},
100109
),
101-
leading: Icon(
102-
Icons.history_outlined,
110+
!kIsWeb
111+
? ListTile(
112+
title: Text(
113+
AppLocalizations.of(context)!.downloads,
114+
),
115+
leading: Icon(
116+
Icons.save_alt_rounded,
117+
),
118+
onTap: () {
119+
context.pop();
120+
context.pushNamed('downloads');
121+
},
122+
)
123+
: Container(),
124+
Divider(
125+
indent: 15,
126+
endIndent: 15,
103127
),
104-
onTap: () {
105-
context.pop();
106-
context.pushNamed('history');
107-
},
108-
),
109-
!kIsWeb
110-
? ListTile(
111-
title: Text(
112-
AppLocalizations.of(context)!.downloads,
113-
),
114-
leading: Icon(
115-
Icons.save_alt_rounded,
116-
),
117-
onTap: () {
118-
context.pop();
119-
context.pushNamed('downloads');
128+
ListTile(
129+
title: Text(
130+
AppLocalizations.of(context)!.settings,
131+
),
132+
leading: Icon(
133+
Icons.settings_outlined,
134+
),
135+
onTap: () {
136+
context.pop();
137+
context.pushNamed(
138+
'settings',
139+
extra: {
140+
'update': homeSetState,
120141
},
121-
)
122-
: Container(),
123-
Divider(
124-
indent: 15,
125-
endIndent: 15,
126-
),
127-
ListTile(
128-
title: Text(
129-
AppLocalizations.of(context)!.settings,
130-
),
131-
leading: Icon(
132-
Icons.settings_outlined,
133-
),
134-
onTap: () {
135-
context.pop();
136-
context.pushNamed(
137-
'settings',
138-
extra: {
139-
'update': homeSetState,
140-
},
141-
);
142-
},
143-
),
144-
ListTile(
145-
title: Text(
146-
AppLocalizations.of(context)!.about,
142+
);
143+
},
147144
),
148-
leading: Icon(
149-
Icons.info_outlined,
145+
ListTile(
146+
title: Text(
147+
AppLocalizations.of(context)!.about,
148+
),
149+
leading: Icon(
150+
Icons.info_outlined,
151+
),
152+
onTap: () {
153+
context.pop();
154+
context.pushNamed('about');
155+
},
150156
),
151-
onTap: () {
152-
context.pop();
153-
context.pushNamed('about');
154-
},
155-
),
156-
enableExperimentalFeatures
157-
? ListTile(
158-
title: Text(
159-
'Live Timing Feed',
160-
),
161-
leading: Icon(
162-
Icons.settings_outlined,
163-
),
164-
onTap: () {
165-
Navigator.of(context).pop();
166-
Navigator.push(
167-
context,
168-
MaterialPageRoute(
169-
builder: (context) => const ArchiveRacesListScreen(),
170-
),
171-
);
172-
},
173-
)
174-
: Container(),
175-
enableExperimentalFeatures
176-
? ListTile(
177-
title: Text(
178-
'Article Test Screen',
179-
),
180-
leading: Icon(
181-
Icons.settings_outlined,
182-
),
183-
onTap: () {
184-
Navigator.of(context).pop();
185-
Navigator.push(
186-
context,
187-
MaterialPageRoute(
188-
builder: (context) => const TestScreen(),
189-
),
190-
);
191-
},
192-
)
193-
: Container(),
194-
enableExperimentalFeatures
195-
? ListTile(
196-
title: Text(
197-
'Compare',
198-
),
199-
leading: Icon(
200-
Icons.compare_arrows_outlined,
201-
),
202-
onTap: () {
203-
Navigator.of(context).pop();
204-
Navigator.push(
205-
context,
206-
MaterialPageRoute(
207-
builder: (context) => const CompareHomeScreen(),
208-
),
209-
);
210-
},
211-
)
212-
: Container(),
213-
],
157+
enableExperimentalFeatures
158+
? ListTile(
159+
title: Text(
160+
'Live Timing Feed',
161+
),
162+
leading: Icon(
163+
Icons.settings_outlined,
164+
),
165+
onTap: () {
166+
Navigator.of(context).pop();
167+
Navigator.push(
168+
context,
169+
MaterialPageRoute(
170+
builder: (context) => const ArchiveRacesListScreen(),
171+
),
172+
);
173+
},
174+
)
175+
: Container(),
176+
enableExperimentalFeatures
177+
? ListTile(
178+
title: Text(
179+
'Article Test Screen',
180+
),
181+
leading: Icon(
182+
Icons.settings_outlined,
183+
),
184+
onTap: () {
185+
Navigator.of(context).pop();
186+
Navigator.push(
187+
context,
188+
MaterialPageRoute(
189+
builder: (context) => const TestScreen(),
190+
),
191+
);
192+
},
193+
)
194+
: Container(),
195+
enableExperimentalFeatures
196+
? ListTile(
197+
title: Text(
198+
'Compare',
199+
),
200+
leading: Icon(
201+
Icons.compare_arrows_outlined,
202+
),
203+
onTap: () {
204+
Navigator.of(context).pop();
205+
Navigator.push(
206+
context,
207+
MaterialPageRoute(
208+
builder: (context) => const CompareHomeScreen(),
209+
),
210+
);
211+
},
212+
)
213+
: Container(),
214+
],
215+
),
214216
);
215217
}
216218
}

0 commit comments

Comments
 (0)