You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.3 KiB
Dart
70 lines
2.3 KiB
Dart
import 'dart:developer';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:hmg_qline/view_models/screen_config_view_model.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:hmg_qline/config/dependency_injection.dart';
|
|
import 'package:hmg_qline/config/routes.dart';
|
|
import 'package:hmg_qline/constants/app_constants.dart';
|
|
import 'package:hmg_qline/view_models/queuing_view_model.dart';
|
|
import 'package:hmg_qline/views/view_helpers/size_config.dart';
|
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
try {
|
|
await AppDependencies.addDependencies();
|
|
await WakelockPlus.enable();
|
|
} catch (e) {
|
|
log('Initialization error: $e');
|
|
}
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
return OrientationBuilder(builder: (context, orientation) {
|
|
SizeConfig().init(constraints, orientation);
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
return MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider<ScreenConfigViewModel>(
|
|
create: (context) => getIt.get<ScreenConfigViewModel>(),
|
|
lazy: false,
|
|
),
|
|
ChangeNotifierProvider<QueuingViewModel>(
|
|
create: (context) => getIt.get<QueuingViewModel>(),
|
|
lazy: false,
|
|
),
|
|
],
|
|
child: MaterialApp(
|
|
showSemanticsDebugger: false,
|
|
title: AppStrings.appName,
|
|
theme: ThemeData(
|
|
fontFamily: AppStrings.fontNamePoppins,
|
|
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.grey).copyWith(
|
|
surface: const Color.fromRGBO(255, 255, 255, 1),
|
|
),
|
|
),
|
|
initialRoute: AppRoutes.initialRoute,
|
|
routes: AppRoutes.routes,
|
|
debugShowCheckedModeBanner: false,
|
|
),
|
|
);
|
|
});
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
// vTJJHSbhMyeq04KfmM3KAg
|