import 'package:flutter/material.dart'; import 'package:fmassive/best_page.dart'; import 'package:fmassive/database.dart'; import 'package:fmassive/edit_set.dart'; import 'package:fmassive/gym_set.dart'; import 'package:fmassive/home_page.dart'; import 'package:fmassive/plans_page.dart'; import 'package:fmassive/settings_page.dart'; import 'package:fmassive/timer_page.dart'; import 'package:fmassive/workouts_page.dart'; MyDatabase db = MyDatabase(); void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { MyApp({Key? key}) : super(key: key); final navigatorKey = GlobalKey(); @override Widget build(BuildContext context) { final edit = EditGymSetPage( gymSet: GymSet(name: '', reps: 0, weight: 0, created: DateTime.now())); final Map routes = { '/home': (context) => HomePage(), '/plans': (context) => const PlansPage(), '/best': (context) => const BestPage(), '/workouts': (context) => const WorkoutsPage(), '/timer': (context) => const TimerPage(), '/settings': (context) => SettingsPage(), '/edit-set': (context) => edit, }; return MaterialApp( title: 'Gym App', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), initialRoute: '/home', routes: routes, navigatorKey: navigatorKey, ); } }