callApiLogout method
Implementation
Future<bool?> callApiLogout(BuildContext context, {bool? clearcache}) async {
Preferences.getApises().then((value) {
if (value != null || value != "") {
Api.createDefaultParams((parameter) {
parameter.set("game_id", Config.idGame);
Helper().checksodium().then((sodim) async{
ParameterRegisterNew par = await Helper().encryparamater(sodim, parameter.getJson(),"register");
Parameter paranew = Parameter();
paranew.set("bla2", par.bla1);
paranew.set("bla3", par.bla2);
paranew.set("bla1", par.postData);
Api(context2: context).execute("pelanggan/logout/", SellonMethod.post, paranew, (response) {
Preferences.clearChace(clearcache: clearcache);
Future.delayed(Duration(seconds: 1)).then((value) {
return true;
});
});
});
});
} else {
Preferences.clearChace();
Future.delayed(Duration(seconds: 1)).then((value) {
return true;
});
}
});
}