loadWidgetScript method
Implementation
Future<void> loadWidgetScript(String url) async {
if(widget.payload == null) {
debugPrint("** bootpayWidget payload data is null !! **");
return;
}
if (url.startsWith(WIDGET_URL)) {
if(widget.payload?.widgetKey == null) debugPrint("** bootpayWidget widgetKey is null !! **");
if(widget.payload?.widgetSandbox == null) debugPrint("** bootpayWidget widgetSandbox is null !! **");
if(widget.payload?.widgetUseTerms == null) debugPrint("** bootpayWidget widgetUseTerms is null !! **");
if(BootpayConfig.ENV == BootpayConfig.ENV_DEBUG) {
widget._controller.runJavaScript("BootpayWidget.setEnvironmentMode('development', '');");
}
//
// widget._controller.runJavaScript(allAgreeWatch);
widget._controller.runJavaScript(readyWatch);
widget._controller.runJavaScript(resizeWatch);
widget._controller.runJavaScript(changeMethodWatch);
widget._controller.runJavaScript(changeTermsWatch);
widget._controller.runJavaScript(renderWidgetJS);
widget._controller.runJavaScript(widget.close);
}
}