Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update FlutterWebView.java
  • Loading branch information
uc-apa authored Apr 30, 2020
commit 1e97e46072600cf8f6cca497c3f328eb1dba1bd3
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
String userAgent = (String) params.get("userAgent");
updateUserAgent(userAgent);
}
if (params.containsKey("initialUrl")) {
if (params.containsKey("html")) {
String html = (String) params.get("html");
if (params.containsKey("baseUrl")) {
String baseUrl = (String) params.get("baseUrl");
webView.loadDataWithBaseURL(baseUrl, html, "text/html", "UTF-8", null);
} else {
webView.loadData(html, "text/html", "UTF-8");
}
} else if (params.containsKey("initialUrl")) {
String url = (String) params.get("initialUrl");
webView.loadUrl(url);
}
Expand Down