2021-09-29 23:57:09 +00:00
|
|
|
import 'package:event/event.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2021-11-11 03:00:38 +00:00
|
|
|
import 'package:pikapika/screens/InitScreen.dart';
|
2022-01-18 06:01:01 +00:00
|
|
|
import 'package:pikapika/basic/Navigator.dart';
|
|
|
|
import 'package:pikapika/screens/components/MouseAndTouchScrollBehavior.dart';
|
2021-09-29 23:57:09 +00:00
|
|
|
|
|
|
|
import 'basic/config/Themes.dart';
|
|
|
|
|
|
|
|
void main() {
|
2021-11-30 02:23:49 +00:00
|
|
|
runApp(PikapikaApp());
|
2021-09-29 23:57:09 +00:00
|
|
|
}
|
|
|
|
|
2021-11-30 02:23:49 +00:00
|
|
|
class PikapikaApp extends StatefulWidget {
|
|
|
|
const PikapikaApp({Key? key}) : super(key: key);
|
2021-09-29 23:57:09 +00:00
|
|
|
|
|
|
|
@override
|
2021-11-30 02:23:49 +00:00
|
|
|
State<StatefulWidget> createState() => _PikapikaAppState();
|
2021-09-29 23:57:09 +00:00
|
|
|
}
|
|
|
|
|
2021-11-30 02:23:49 +00:00
|
|
|
class _PikapikaAppState extends State<PikapikaApp> {
|
2021-09-29 23:57:09 +00:00
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
themeEvent.subscribe(_onChangeTheme);
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
themeEvent.unsubscribe(_onChangeTheme);
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
void _onChangeTheme(EventArgs? args) {
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
2022-01-18 06:01:01 +00:00
|
|
|
scrollBehavior: mouseAndTouchScrollBehavior,
|
2021-09-29 23:57:09 +00:00
|
|
|
theme: currentThemeData(),
|
2021-10-15 06:18:29 +00:00
|
|
|
darkTheme: currentDarkTheme(),
|
2021-09-29 23:57:09 +00:00
|
|
|
navigatorObservers: [navigatorObserver, routeObserver],
|
|
|
|
home: InitScreen(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|