Simplify main.dart
This commit is contained in:
parent
4a83465d82
commit
b617724f0a
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fmassive/database.dart';
|
import 'package:fmassive/database.dart';
|
||||||
import 'package:fmassive/edit_set.dart';
|
|
||||||
import 'package:fmassive/home_page.dart';
|
import 'package:fmassive/home_page.dart';
|
||||||
|
|
||||||
MyDatabase db = MyDatabase();
|
MyDatabase db = MyDatabase();
|
||||||
|
@ -16,20 +15,12 @@ class MyApp extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
const edit = EditGymSetPage(gymSet: GymSetsCompanion());
|
|
||||||
|
|
||||||
final Map<String, WidgetBuilder> routes = {
|
|
||||||
'/home': (context) => const HomePage(),
|
|
||||||
'/edit-set': (context) => edit,
|
|
||||||
};
|
|
||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Gym App',
|
title: 'Massive',
|
||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.system,
|
||||||
|
home: const HomePage(),
|
||||||
darkTheme: ThemeData.dark(),
|
darkTheme: ThemeData.dark(),
|
||||||
theme: ThemeData.light(),
|
theme: ThemeData.light(),
|
||||||
initialRoute: '/home',
|
|
||||||
routes: routes,
|
|
||||||
navigatorKey: navigatorKey,
|
navigatorKey: navigatorKey,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user