checkResponse static method

bool checkResponse(
  1. BuildContext context,
  2. BaseResponse response,
  3. Function logout,
  4. Color primaryColor, {
  5. bool showError = true,
  6. 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;
}