import 'package:flutter/material.dart'; import 'package:openmediacentermobile/utils/feature_context.dart'; import 'drawer_context.dart'; import 'drawer_page.dart'; class MyDrawer extends StatelessWidget { const MyDrawer({Key? key}) : super(key: key); @override Widget build(BuildContext context) { final ctx = DrawerContext.of(context); final featureCtx = FeatureContext.of(context); return Drawer( child: ListView(children: [ ListTile( title: const Text('Home'), leading: const Icon(Icons.home), onTap: () { ctx.onChangePage(Section.HOME); Navigator.pop(context); }, ), ListTile( title: const Text('Shuffle'), leading: const Icon(Icons.update), onTap: () { ctx.onChangePage(Section.SHUFFLE); Navigator.pop(context); }, ), ListTile( title: const Text('Categories'), leading: const Icon(Icons.category), onTap: () { ctx.onChangePage(Section.CATEGORIE); Navigator.pop(context); }, ), ListTile( title: const Text('Actors'), leading: const Icon(Icons.people), onTap: () { ctx.onChangePage(Section.ACTOR); Navigator.pop(context); }, ), if (featureCtx.tvShowEnabled) ListTile( title: const Text('TV Shows'), leading: const Icon(Icons.tv), onTap: () { ctx.onChangePage(Section.TVSHOW); Navigator.pop(context); }, ), ListTile( title: const Text('Settings'), leading: const Icon(Icons.settings), onTap: () { ctx.onChangePage(Section.SETTING); Navigator.pop(context); }, ), ]), ); } }