loadWidgetScript method

Future<void> loadWidgetScript(
  1. String url
)

Implementation

Future<void> loadWidgetScript(String url) async {

  if(payload == null) {
    debugPrint("** bootpayWidget payload data is null !! **");
    return;
  }
  if (url.startsWith(WIDGET_URL)) {
    if(payload?.widgetKey == null) debugPrint("** bootpayWidget widgetKey is null !! **");
    if(payload?.widgetSandbox == null) debugPrint("** bootpayWidget widgetSandbox is null !! **");
    if(payload?.widgetUseTerms == null) debugPrint("** bootpayWidget widgetUseTerms is null !! **");

    if(BootpayConfig.ENV == BootpayConfig.ENV_DEBUG) {
      _controller.runJavaScript("BootpayWidget.setEnvironmentMode('development');");
    }
    //
    // widget._controller.runJavaScript(allAgreeWatch);
    _controller.runJavaScript(readyWatch);
    _controller.runJavaScript(resizeWatch);
    _controller.runJavaScript(changeMethodWatch);
    _controller.runJavaScript(changeTermsWatch);
    _controller.runJavaScript(renderWidgetJS);
    _controller.runJavaScript(closeEventHandler);
  }
}