Closed hariyanuar closed 2 years ago
So apparently when the webview.loadContent future is done, the js page actually hasnt been loaded yet. So I moved the code to call the js method to onPageFinished and seemed to fix the issue.
webViewController
.loadContent('assets/html/snap.html', SourceType.html, fromAssets: true)
.then((_) async => await webViewController.callJsMethod("pay", [transactionToken, Config.midtransURL, Config.midtransClientKey]));
onPageFinished: (_) async {
await webViewXController.callJsMethod("pay", [
paymentInfo.token,
Config.midtransURL,
Config.midtransClientKey
]);
},
Im trying to build a webview which have a dynamic script and call a function of that script whent the page is loaded. But I'm getting no such method error on callJsMethod even though I have created the method in jsContent.
This is the log
This is the page source code
This is the snap.html