I am trying to display some static html in an app using the webview_flutter plugin.
body: WebView(
initialUrl: Uri.dataFromString(
htmlString,
mimeType: 'text/html',
encoding: Encoding('utf-8')
).toString(),
),
I was getting an error about an invalid character error, and I assumed that is because Uri defaults to ASCII. I am trying to set the character encoding to UTF-8 but I can't figure out how to do it. Encoding('utf-8')
is obviously not right.
How do I set the encoding?