bottom modal sheet fixes

update-to-3.32-sdk
haroon amjad 2 months ago
parent d99b66105e
commit 1babfdf5d7

@ -107,7 +107,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
late Timer timeOutTimer; late Timer timeOutTimer;
bool isTalking = false; bool isTalking = false;
var sharedPref = new AppSharedPreferences(); bool isModalBottomSheetShowing = false;
// //
// var data = { // var data = {
@ -733,17 +733,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
checkLastLoginStatus(AuthenticatedUser user, String deviceToken) async { checkLastLoginStatus(AuthenticatedUser user, String deviceToken) async {
int lastLoginStatus = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) : 1; int lastLoginStatus = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) : 1;
if (lastLoginStatus == 1 || lastLoginStatus == 4) { // if (lastLoginStatus == 1 || lastLoginStatus == 4) {
if (await sharedPref.getBool(HAS_ENABLED_QUICK_LOGIN) == null || !await sharedPref.getBool(HAS_ENABLED_QUICK_LOGIN)) { // if (await sharedPref.getBool(HAS_ENABLED_QUICK_LOGIN) == null || !await sharedPref.getBool(HAS_ENABLED_QUICK_LOGIN)) {
showQuickLoginBottomSheet(context, user, deviceToken, false); showQuickLoginBottomSheet(context, user, deviceToken, false);
} // }
// showQuickLoginBottomSheet(context, user, deviceToken, false); // showQuickLoginBottomSheet(context, user, deviceToken, false);
} // }
} }
void showQuickLoginBottomSheet(BuildContext context, AuthenticatedUser user, String deviceToken, bool isDone) { void showQuickLoginBottomSheet(BuildContext context, AuthenticatedUser user, String deviceToken, bool isDone) async {
showModalBottomSheet( isModalBottomSheetShowing = true;
await showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
isScrollControlled: true, isScrollControlled: true,
@ -762,6 +763,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
), ),
).then((value) { ).then((value) {
sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, value ?? true); sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, value ?? true);
isModalBottomSheetShowing = false;
}); });
} }
@ -809,7 +811,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
showQuickLoginBottomSheet(context, user, deviceToken, true); showQuickLoginBottomSheet(context, user, deviceToken, true);
Future.delayed(Duration(seconds: 3), () { Future.delayed(Duration(seconds: 3), () {
Navigator.of(context).pop(); if (isModalBottomSheetShowing) {
Navigator.of(context).pop();
}
}); });
insertIMEI(lastLogin, deviceToken); insertIMEI(lastLogin, deviceToken);
} }

Loading…
Cancel
Save