handleLogout method
Implementation
Future<bool?> handleLogout(BuildContext context,
{bool? noCallApi, bool? clearcache}) async {
Config.isCheckVerifAgain = false;
Config.loginWith = LoginWith.nonLogin;
_googleSignIn.disconnect();
try {
await _googleSignIn.signOut().then((value) {});
} catch (error) {
print(error);
}
Preferences.getApises().then((value) {
if (value != null || value != "") {
if (noCallApi == null) {
callApiLogout(context, clearcache: clearcache).then((value){
if (value != null && value){
return true;
}
});
} else {
Preferences.clearChace();
Future.delayed(Duration(seconds: 1)).then((value) {
return true;
});
}
} else {
Future.delayed(Duration(seconds: 1)).then((value) {
return true;
});
}
});
}