2021-09-29 23:57:09 +00:00
|
|
|
import 'package:event/event.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:pikapi/screens/InitScreen.dart';
|
|
|
|
import 'package:pikapi/basic/Navigatior.dart';
|
|
|
|
|
|
|
|
import 'basic/config/Themes.dart';
|
|
|
|
|
|
|
|
void main() {
|
2021-10-13 13:57:35 +00:00
|
|
|
runApp(PikapiApp());
|
2021-09-29 23:57:09 +00:00
|
|
|
}
|
|
|
|
|
2021-10-13 13:57:35 +00:00
|
|
|
class PikapiApp extends StatefulWidget {
|
|
|
|
const PikapiApp({Key? key}) : super(key: key);
|
2021-09-29 23:57:09 +00:00
|
|
|
|
|
|
|
@override
|
2021-10-13 13:57:35 +00:00
|
|
|
State<StatefulWidget> createState() => _PikapiAppState();
|
2021-09-29 23:57:09 +00:00
|
|
|
}
|
|
|
|
|
2021-10-13 13:57:35 +00:00
|
|
|
class _PikapiAppState extends State<PikapiApp> {
|
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(
|
|
|
|
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(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|