46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
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';
|
|
|
|
void main() {
|
|
runApp(MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
MyApp({Key? key}) : super(key: key);
|
|
|
|
final navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
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,
|
|
};
|
|
|
|
return MaterialApp(
|
|
title: 'Gym App',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
),
|
|
initialRoute: '/home',
|
|
routes: routes,
|
|
navigatorKey: navigatorKey,
|
|
);
|
|
}
|
|
}
|