|
|
|
|
@ -30,12 +30,11 @@ void main() async {
|
|
|
|
|
|
|
|
|
|
//clearing all the shared pref on the inital start to avoid any profile issue
|
|
|
|
|
Future<void> clearPrefsOnFirstLaunch() async {
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences. getInstance();
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
|
|
|
bool isFirstLaunch = prefs.getBool('isFirstLaunch') ?? true;
|
|
|
|
|
await prefs.clear(); // Clear all prefs
|
|
|
|
|
await prefs.clear(); // Clear all prefs
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -60,37 +59,41 @@ class MyApp extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
child: Consumer<ProjectViewModel>(
|
|
|
|
|
builder: (context, projectProvider, child) => MaterialApp(
|
|
|
|
|
showSemanticsDebugger: false,
|
|
|
|
|
title: 'Doctors App',
|
|
|
|
|
locale: projectProvider.appLocal,
|
|
|
|
|
localizationsDelegates: [
|
|
|
|
|
TranslationBaseDelegate(),
|
|
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
|
|
|
|
GlobalCupertinoLocalizations.delegate,
|
|
|
|
|
DefaultCupertinoLocalizations.delegate
|
|
|
|
|
],
|
|
|
|
|
supportedLocales: [
|
|
|
|
|
const Locale('ar', ''), // Arabic
|
|
|
|
|
const Locale('en', ''), // English
|
|
|
|
|
],
|
|
|
|
|
theme: ThemeData(
|
|
|
|
|
primarySwatch: Colors.grey,
|
|
|
|
|
primaryColor: Colors.grey,
|
|
|
|
|
//buttonColor: HexColor('#D02127'),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
dividerColor: Colors.grey[350],
|
|
|
|
|
builder: (context, projectProvider, child) => SafeArea(
|
|
|
|
|
top: false,
|
|
|
|
|
bottom: Platform.isAndroid ? true : false,
|
|
|
|
|
child: MaterialApp(
|
|
|
|
|
showSemanticsDebugger: false,
|
|
|
|
|
title: 'Doctors App',
|
|
|
|
|
locale: projectProvider.appLocal,
|
|
|
|
|
localizationsDelegates: [
|
|
|
|
|
TranslationBaseDelegate(),
|
|
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
|
|
|
|
GlobalCupertinoLocalizations.delegate,
|
|
|
|
|
DefaultCupertinoLocalizations.delegate
|
|
|
|
|
],
|
|
|
|
|
supportedLocales: [
|
|
|
|
|
const Locale('ar', ''), // Arabic
|
|
|
|
|
const Locale('en', ''), // English
|
|
|
|
|
],
|
|
|
|
|
theme: ThemeData(
|
|
|
|
|
primarySwatch: Colors.grey,
|
|
|
|
|
primaryColor: Colors.grey,
|
|
|
|
|
//buttonColor: HexColor('#D02127'),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
dividerColor: Colors.grey[350],
|
|
|
|
|
|
|
|
|
|
// backgroundColor: Color.fromRGBO(255, 255, 255, 1),
|
|
|
|
|
useMaterial3: false),
|
|
|
|
|
navigatorKey: locator<NavigationService>().navigatorKey,
|
|
|
|
|
navigatorObservers: [
|
|
|
|
|
locator<AnalyticsService>().getAnalyticsObserver(),
|
|
|
|
|
],
|
|
|
|
|
initialRoute: INIT_ROUTE,
|
|
|
|
|
routes: routes,
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
|
// backgroundColor: Color.fromRGBO(255, 255, 255, 1),
|
|
|
|
|
useMaterial3: false),
|
|
|
|
|
navigatorKey: locator<NavigationService>().navigatorKey,
|
|
|
|
|
navigatorObservers: [
|
|
|
|
|
locator<AnalyticsService>().getAnalyticsObserver(),
|
|
|
|
|
],
|
|
|
|
|
initialRoute: INIT_ROUTE,
|
|
|
|
|
routes: routes,
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|