У меня есть файл html, который загружает файлы css, шрифтов и изображений. В настоящее время мой веб-просмотр загружается без загрузки каких-либо дополнительных файлов, изображения не отображаются, CSS не отображается. Я так пытаюсь:
loadHtmlFromAssets();
return WebviewScaffold(
appBar: AppBar(
title: Text("Web", style: TextStyle(color: Colors.black),),
backgroundColor: Colors.white,
iconTheme: IconThemeData(
color: Colors.black
),
),
url: 'about:blank',
withZoom: false,
withJavascript: true,
allowFileURLs: true,
withLocalUrl: true,
localUrlScope: 'assets/maphtml/',
withLocalStorage: true,
);
loadHtmlFromAssets() async {
String fileText = await rootBundle.loadString('assets/maphtml/zemelapis.html');
flutterWebViewPlugin.reloadUrl(Uri.dataFromString(fileText, mimeType: 'text/html', encoding: Encoding.getByName("utf-8")).toString());
}
Ресурсы в html имеют предполагаемый префикс расположения zemelapis.html, например
<script src="js/image-map-pro.min.js"></script>