54 lines
1.3 KiB
Dart
54 lines
1.3 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:go_router/go_router.dart';
|
||
|
import 'package:moody/views/entry_view/entry_page.dart';
|
||
|
import 'package:moody/views/home_page/kalendartryhome_page.dart';
|
||
|
import 'package:moody/views/statistic/statistic_page.dart';
|
||
|
import 'package:moody/views/write_page/write_page.dart';
|
||
|
|
||
|
void main() => runApp(const MyApp());
|
||
|
|
||
|
final GoRouter _router = GoRouter(
|
||
|
routes: [
|
||
|
GoRoute(
|
||
|
path: '/',
|
||
|
builder: (context, state) => StatisticPage(),
|
||
|
),
|
||
|
GoRoute(
|
||
|
path: '/moods',
|
||
|
builder: (context, state) => CalendarPage(),
|
||
|
),
|
||
|
GoRoute(
|
||
|
path: '/home',
|
||
|
builder: (context, state) => CalendarPage(),
|
||
|
),
|
||
|
GoRoute(
|
||
|
path: '/write',
|
||
|
builder: (context, state) {
|
||
|
final moodPercentage = state.extra as double;
|
||
|
return WritePage(moodPercentage: moodPercentage);
|
||
|
},
|
||
|
),
|
||
|
GoRoute(
|
||
|
path: '/entry',
|
||
|
builder: (context, state) {
|
||
|
final date = state.extra as DateTime;
|
||
|
return EntryPage(
|
||
|
date: date,
|
||
|
);
|
||
|
},
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
|
||
|
class MyApp extends StatelessWidget {
|
||
|
const MyApp({super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return MaterialApp.router(
|
||
|
theme: ThemeData(fontFamily: 'ABCFavorit'),
|
||
|
routerConfig: _router,
|
||
|
);
|
||
|
}
|
||
|
}
|