diff --git a/lib/main.dart b/lib/main.dart index c297a40..b895bc5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,27 +30,52 @@ class MyHomePage extends StatefulWidget { State createState() => _MyHomePageState(); } +enum GameType { classicTTC, superTTC } + class _MyHomePageState extends State { + GameType type = GameType.classicTTC; + final GlobalKey _scaffoldKey = GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( drawer: Drawer( + key: _scaffoldKey, child: ListView( - children: [ - DrawerHeader( - child: Text("Game Types"), - ), - ListTile(title: Text("Clasic")), - ListTile(title: Text("Super")), - ], - )), + children: [ + const DrawerHeader( + child: Text( + "Game Types", + style: TextStyle(fontSize: 25), + ), + ), + ListTile( + title: const Text("Classic"), + onTap: () { + setState(() { + type = GameType.classicTTC; + }); + Navigator.pop(context); + }, + ), + ListTile( + title: const Text("Super"), + onTap: () { + setState(() { + type = GameType.superTTC; + }); + Navigator.pop(context); + }), + ], + )), appBar: AppBar( title: Text(widget.title), backgroundColor: Theme.of(context).colorScheme.inversePrimary, ), body: Padding( padding: const EdgeInsets.all(10), - child: ClassicGame(), + child: type == GameType.classicTTC + ? const ClassicGame() + : const Center(child: Text("Under Construction")), )); } }