mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-14 09:17:23 +00:00
initialized Dashboard Page
This commit is contained in:
@ -1,33 +1,43 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/services/locator.dart';
|
||||
import 'package:syncrow_app/utils/bloc_observer.dart';
|
||||
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
||||
|
||||
import 'my_app.dart';
|
||||
|
||||
void main() {
|
||||
//to observe the state of the blocs in the output console
|
||||
Bloc.observer = MyBlocObserver();
|
||||
//TODO: Uncomment
|
||||
// runZonedGuarded(() async {
|
||||
// const environment =
|
||||
// String.fromEnvironment('FLAVOR', defaultValue: 'production');
|
||||
// await dotenv.load(fileName: '.env.$environment');
|
||||
//
|
||||
// HttpOverrides.global = MyHttpOverrides();
|
||||
// WidgetsFlutterBinding.ensureInitialized();
|
||||
// LicenseRegistry.addLicense(() async* {
|
||||
// final license =
|
||||
// await rootBundle.loadString('assets/fonts/roboto/LICENSE.txt');
|
||||
// yield LicenseEntryWithLineBreaks(['google_fonts'], license);
|
||||
// });
|
||||
// initialSetup();
|
||||
// await LocalizationService.saveLocale(const Locale("en", "AE"));
|
||||
//
|
||||
// final savedLocale = await LocalizationService.savedLocale();
|
||||
//
|
||||
// runApp(const MyApp(Locale('en', '')));
|
||||
// }, (error, stackTrace) {
|
||||
// FirebaseCrashlytics.instance.recordError(error, stackTrace, fatal: true);
|
||||
// });
|
||||
//to catch all the errors in the app and send them to firebase
|
||||
runZonedGuarded(() async {
|
||||
//to load the environment variables
|
||||
// const environment =
|
||||
// String.fromEnvironment('FLAVOR', defaultValue: 'production');
|
||||
// await dotenv.load(fileName: '.env.$environment');
|
||||
|
||||
runApp(const MyApp(Locale('en', '')));
|
||||
// //this is to make the app work with the self-signed certificate
|
||||
// HttpOverrides.global = MyHttpOverrides();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
//license for the font
|
||||
// LicenseRegistry.addLicense(() async* {
|
||||
// final license =
|
||||
// await rootBundle.loadString('assets/fonts/roboto/LICENSE.txt');
|
||||
// yield LicenseEntryWithLineBreaks(['google_fonts'], license);
|
||||
// });
|
||||
|
||||
//to initialize the locator
|
||||
initialSetup();
|
||||
|
||||
//to save the locale in the shared preferences
|
||||
await LocalizationService.saveLocale(const Locale("en", "AE"));
|
||||
final savedLocale = await LocalizationService.savedLocale();
|
||||
|
||||
runApp(MyApp(savedLocale));
|
||||
}, (error, stackTrace) {
|
||||
// FirebaseCrashlytics.instance.recordError(error, stackTrace, fatal: true);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user