initialized Dashboard Page

This commit is contained in:
Mohammad Salameh
2024-02-20 12:08:59 +03:00
parent 0c390a8062
commit d27063f149
98 changed files with 1704 additions and 824 deletions

View File

@ -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);
});
}