Reputation: 153
how to display webview using parameters. here I have successfully displayed the webview but the token that I entered into the html code value is not readable, how can I enter the token into the html code value? what is the correct way?
UI
_buildWebView(String token){
return WebviewScaffold(
withJavascript: true,
appCacheEnabled: true,
url: new Uri.dataFromString(_loadHTML(token), mimeType: 'text/html').toString(),
);
}
String _loadHTML(String token) {
return r'''
<html>
<body onload="document.f.submit();">
<form id="f" name="f" method="post" action="https://payment/rrr">
<input type="hidden" name="Massage" value=$token/>
</form>
</body>
</html>
''';
}
Upvotes: 0
Views: 1630
Reputation: 31
this might work
String _loadHTML(String token) {
return r'''
<html>
<body onload="document.f.submit();">
<form id="f" name="f" method="post" action="https://payment/rrr">
<input type="hidden" name="Massage" value='''+token+''''/>
</form>
</body>
</html>
'''; }
Upvotes: 1