65 lines
2.0 KiB
Dart
65 lines
2.0 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:satu/routes/router.dart';
|
|
import 'package:satu/shared/app_colors.dart';
|
|
import 'package:satu/views/start_up/start_up_view.dart';
|
|
import 'package:satu/widgets/dialog/dialog_manager.dart';
|
|
|
|
import 'core/redux/store.dart';
|
|
import 'core/services/dialog_service.dart';
|
|
import 'core/services/navigator_service.dart';
|
|
import 'core/utils/locator.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
//initialize locator
|
|
await LocatorInjector.setupLocator();
|
|
|
|
LicenseRegistry.addLicense(() async* {
|
|
final license = await rootBundle.loadString('assets/google_fonts/OFL.txt');
|
|
yield LicenseEntryWithLineBreaks(['google_fonts'], license);
|
|
});
|
|
|
|
await Redux.init();
|
|
runApp(MainApplication());
|
|
}
|
|
|
|
|
|
class MainApplication extends StatelessWidget {
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
return StoreProvider<AppState>(
|
|
store: Redux.store,
|
|
child: ScreenUtilInit(
|
|
designSize: Size(411.43, 683.43),
|
|
builder: () => MaterialApp(
|
|
theme: ThemeData(
|
|
backgroundColor: backgroundColor,
|
|
primaryColor: whiteColor,
|
|
accentColor: yellowColor,
|
|
scaffoldBackgroundColor: fillColor,
|
|
// textTheme: GoogleFonts.robotoTextTheme(
|
|
// Theme.of(context).textTheme,
|
|
// )
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
builder: (context, child) => Navigator(
|
|
key: locator<DialogService>().dialogNavigationKey,
|
|
onGenerateRoute: (settings) => MaterialPageRoute(
|
|
builder: (context) => DialogManager(child: child)),
|
|
),
|
|
navigatorKey: locator<NavigatorService>().navigatorKey,
|
|
home: StartUpView(), // first page
|
|
onGenerateRoute: generateRoute,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|