checkResponse static method
bool
checkResponse(
- BuildContext context,
- BaseResponse response,
- Function logout,
- Color primaryColor, {
- bool showError = true,
- bool passString = false,
Implementation
static bool checkResponse(BuildContext context, BaseResponse response, Function logout,
Color primaryColor, {bool showError = true, bool passString = false}) {
if (response.checkTimeout()) {
showCustomAlertDialog(context, MultiLanguage.get(CoreLanguageKey.msgAnotherLogin),
primaryColor: primaryColor).then((value) => logout(context));
return false;
}
if (response.checkOK(passString: passString)) return true;
if (showError && response.data != null) showCustomAlertDialog(context, response.data, primaryColor: primaryColor);
return false;
}