requestDeleteCard method

Future<void> requestDeleteCard(
  1. BioPayload payload,
  2. int type, {
  3. bool? doWorkNow = true,
})

Implementation

Future<void> requestDeleteCard(BioPayload payload, int type, {bool? doWorkNow = true}) async {
  this.payload = payload;
  requestType = type;

  SharedPreferences prefs = await SharedPreferences.getInstance();
  String passwordToken =  prefs.getString('password_token') ?? '';
  payload.token = passwordToken;

  String script = await BioConstants.getJSDestroyWallet(payload);
  updateProgressShow(true);
  if(doWorkNow == true) {
    webView?.controller?.runJavaScript(
        callJavascriptAsync(script)
    );

    // webView?.controller?.future.then((controller) {
    //   controller.runJavascript(
    //       callJavascriptAsync(script)
    //   );
    // });
  } else {
    webView?.startScript = script;
  }
}