import 'package:flutter/material.dart'; import 'clasic.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Super Tic-Tac-Toe', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Local Tic Tac Toe'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override 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: [ 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: type == GameType.classicTTC ? const ClassicGame() : const Center(child: Text("Under Construction")), )); } }