@@ -13,6 +13,7 @@ import 'package:nextcloud_cookbook_flutter/src/screens/recipe_import_screen.dart
1313import 'package:nextcloud_cookbook_flutter/src/screens/recipes_list_screen.dart' ;
1414import 'package:nextcloud_cookbook_flutter/src/screens/timer_screen.dart' ;
1515import 'package:nextcloud_cookbook_flutter/src/widget/category_card.dart' ;
16+ import 'package:nextcloud_cookbook_flutter/src/widget/drawer_item.dart' ;
1617import 'package:nextcloud_cookbook_flutter/src/widget/user_image.dart' ;
1718import 'package:search_page/search_page.dart' ;
1819
@@ -222,7 +223,6 @@ class MainDrawer extends StatelessWidget {
222223 Widget build (BuildContext context) {
223224 return Drawer (
224225 child: ListView (
225- // Important: Remove any padding from the ListView.
226226 padding: EdgeInsets .zero,
227227 children: < Widget > [
228228 DrawerHeader (
@@ -231,12 +231,9 @@ class MainDrawer extends StatelessWidget {
231231 ),
232232 child: const UserImage (),
233233 ),
234- ListTile (
235- trailing: Icon (
236- Icons .alarm_add_outlined,
237- semanticLabel: translate ('timer.title' ),
238- ),
239- title: Text (translate ('timer.title' )),
234+ DrawerItem (
235+ icon: Icons .alarm_add_outlined,
236+ title: translate ('timer.title' ),
240237 onTap: () {
241238 Navigator .pop (context);
242239 Navigator .push (
@@ -247,12 +244,9 @@ class MainDrawer extends StatelessWidget {
247244 );
248245 },
249246 ),
250- ListTile (
251- trailing: Icon (
252- Icons .cloud_download_outlined,
253- semanticLabel: translate ('categories.drawer.import' ),
254- ),
255- title: Text (translate ('categories.drawer.import' )),
247+ DrawerItem (
248+ icon: Icons .cloud_download_outlined,
249+ title: translate ('categories.drawer.import' ),
256250 onTap: () {
257251 Navigator .pop (context);
258252 Navigator .push (
@@ -263,12 +257,9 @@ class MainDrawer extends StatelessWidget {
263257 );
264258 },
265259 ),
266- ListTile (
267- trailing: Icon (
268- Icons .settings_outlined,
269- semanticLabel: translate ('categories.drawer.settings' ),
270- ),
271- title: Text (translate ('categories.drawer.settings' )),
260+ DrawerItem (
261+ icon: Icons .settings_outlined,
262+ title: translate ('categories.drawer.settings' ),
272263 onTap: () async {
273264 await Navigator .push (
274265 context,
@@ -278,12 +269,9 @@ class MainDrawer extends StatelessWidget {
278269 );
279270 },
280271 ),
281- ListTile (
282- trailing: Icon (
283- Icons .exit_to_app_outlined,
284- semanticLabel: translate ('app_bar.logout' ),
285- ),
286- title: Text (translate ('app_bar.logout' )),
272+ DrawerItem (
273+ icon: Icons .exit_to_app_outlined,
274+ title: translate ('app_bar.logout' ),
287275 onTap: () {
288276 BlocProvider .of <AuthenticationBloc >(context)
289277 .add (const LoggedOut ());
0 commit comments