fmassive/lib/main.dart

46 lines
1.3 KiB
Dart
Raw Normal View History

2023-03-30 02:19:24 +00:00
import 'package:flutter/material.dart';
2023-04-06 23:50:02 +00:00
import 'package:fmassive/best_page.dart';
import 'package:fmassive/edit_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';
2023-03-30 02:19:24 +00:00
void main() {
2023-04-05 00:24:48 +00:00
runApp(MyApp());
2023-03-30 02:19:24 +00:00
}
class MyApp extends StatelessWidget {
2023-04-06 23:50:02 +00:00
MyApp({Key? key}) : super(key: key);
final navigatorKey = GlobalKey<NavigatorState>();
2023-03-30 02:19:24 +00:00
@override
Widget build(BuildContext context) {
2023-04-06 23:50:02 +00:00
final edit = EditGymSetPage(
gymSet: GymSet(name: '', reps: 0, weight: 0, created: DateTime.now()));
final Map<String, WidgetBuilder> routes = {
'/home': (context) => HomePage(),
'/plans': (context) => const PlansPage(),
'/best': (context) => const BestPage(),
'/workouts': (context) => const WorkoutsPage(),
'/timer': (context) => const TimerPage(),
'/settings': (context) => const SettingsPage(),
'/edit-set': (context) => edit,
};
2023-03-30 02:19:24 +00:00
return MaterialApp(
2023-04-05 00:24:48 +00:00
title: 'Gym App',
2023-03-30 02:19:24 +00:00
theme: ThemeData(
primarySwatch: Colors.blue,
2023-04-05 00:24:48 +00:00
visualDensity: VisualDensity.adaptivePlatformDensity,
2023-03-30 02:19:24 +00:00
),
2023-04-06 23:50:02 +00:00
initialRoute: '/home',
routes: routes,
navigatorKey: navigatorKey,
2023-03-30 02:19:24 +00:00
);
}
}