checkMainError method

void checkMainError()

Implementation

void checkMainError() async {
  var data = await _webController?.evaluateJavascript(
      source:
          "(function() { var item = document.getElementById('main-message'); return item.innerHTML; })();");
  if (data is String) {
    if (data != "null" && data.isNotEmpty) {
      if (data.toLowerCase().contains("otp")) {
        showToast(
          "Incorrect OTP, please retry eKYC again.",
          callback: () {
            stopSdk();
          },
        );
      } else {
        showToast(
          data,
          callback: () => stopSdk(),
        );
      }
    }
  }
}