|
|
|
|
@ -17,15 +17,25 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
void main() async {
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
await Firebase.initializeApp();
|
|
|
|
|
HttpOverrides.global = MyHttpOverrides();
|
|
|
|
|
setupLocator();
|
|
|
|
|
await clearPrefsOnFirstLaunch();
|
|
|
|
|
runApp(MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//clearing all the shared pref on the inital start to avoid any profile issue
|
|
|
|
|
Future<void> clearPrefsOnFirstLaunch() async {
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences. getInstance();
|
|
|
|
|
bool isFirstLaunch = prefs.getBool('isFirstLaunch') ?? true;
|
|
|
|
|
await prefs.clear(); // Clear all prefs
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|