2023-03-30 15:19:24 +13:00
|
|
|
import 'package:flutter/material.dart';
|
2023-04-09 14:39:41 +12:00
|
|
|
import 'package:fmassive/database.dart';
|
2023-04-07 11:50:02 +12:00
|
|
|
import 'package:fmassive/edit_set.dart';
|
|
|
|
import 'package:fmassive/home_page.dart';
|
2023-03-30 15:19:24 +13:00
|
|
|
|
2023-04-09 14:39:41 +12:00
|
|
|
MyDatabase db = MyDatabase();
|
|
|
|
|
2023-03-30 15:19:24 +13:00
|
|
|
void main() {
|
2023-04-05 12:24:48 +12:00
|
|
|
runApp(MyApp());
|
2023-03-30 15:19:24 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
2023-04-07 11:50:02 +12:00
|
|
|
MyApp({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
final navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
|
2023-03-30 15:19:24 +13:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-04-11 11:41:10 +12:00
|
|
|
const edit = EditGymSetPage(gymSet: GymSetsCompanion());
|
2023-04-07 11:50:02 +12:00
|
|
|
|
|
|
|
final Map<String, WidgetBuilder> routes = {
|
2023-04-11 11:41:10 +12:00
|
|
|
'/home': (context) => const HomePage(),
|
2023-04-07 11:50:02 +12:00
|
|
|
'/edit-set': (context) => edit,
|
|
|
|
};
|
|
|
|
|
2023-03-30 15:19:24 +13:00
|
|
|
return MaterialApp(
|
2023-04-05 12:24:48 +12:00
|
|
|
title: 'Gym App',
|
2023-03-30 15:19:24 +13:00
|
|
|
theme: ThemeData(
|
|
|
|
primarySwatch: Colors.blue,
|
2023-04-05 12:24:48 +12:00
|
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
2023-03-30 15:19:24 +13:00
|
|
|
),
|
2023-04-07 11:50:02 +12:00
|
|
|
initialRoute: '/home',
|
|
|
|
routes: routes,
|
|
|
|
navigatorKey: navigatorKey,
|
2023-03-30 15:19:24 +13:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|