shared pref issue fixed

update_flutter_3.16.0_sdk-upgrade
Sultan Khan 3 months ago
parent e8fb4d09b6
commit d6a8953909

@ -4,14 +4,14 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://uat.hmgwebservices.com/';
// const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL_LIVE_CARE = 'https://uat.hmgwebservices.com/';
const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'http://10.20.200.111:1010/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';

@ -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) {

Loading…
Cancel
Save