Merge pull request #1937 from michalsrutek/feature/fix-typos

Fix typos
This commit is contained in:
Lorenzo Pichilli 2023-12-23 14:13:09 +01:00 committed by GitHub
commit d0a8d6fb4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 73 additions and 73 deletions

View File

@ -52,10 +52,10 @@ public class PlatformUtil extends ChannelDelegateImpl {
if (locale == null) { if (locale == null) {
return Locale.US; return Locale.US;
} }
String[] localeSplitted = locale.split("_"); String[] localeSplit = locale.split("_");
String language = localeSplitted[0]; String language = localeSplit[0];
String country = localeSplitted.length > 1 ? localeSplitted[1] : ""; String country = localeSplit.length > 1 ? localeSplit[1] : "";
String variant = localeSplitted.length > 2 ? localeSplitted[2] : ""; String variant = localeSplit.length > 2 ? localeSplit[2] : "";
return new Locale(language, country, variant); return new Locale(language, country, variant);
} }

View File

@ -202,7 +202,7 @@ public class Util {
/** /**
* SslCertificate class does not has a public getter for the underlying * SslCertificate class does not has a public getter for the underlying
* X509Certificate, we can only do this by hack. This only works for andorid 4.0+ * X509Certificate, we can only do this by hack. This only works for Android 4.0+
* https://groups.google.com/forum/#!topic/android-developers/eAPJ6b7mrmg * https://groups.google.com/forum/#!topic/android-developers/eAPJ6b7mrmg
*/ */
public static X509Certificate getX509CertFromSslCertHack(SslCertificate sslCert) { public static X509Certificate getX509CertFromSslCertHack(SslCertificate sslCert) {

View File

@ -62,8 +62,8 @@ public class ContentBlockerHandler {
try { try {
u = new URI(url); u = new URI(url);
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
String[] urlSplitted = url.split(":"); String[] urlSplit = url.split(":");
String scheme = urlSplitted[0]; String scheme = urlSplit[0];
URL tempUrl = new URL(url.replace(scheme, "https")); URL tempUrl = new URL(url.replace(scheme, "https"));
u = new URI(scheme, tempUrl.getUserInfo(), tempUrl.getHost(), tempUrl.getPort(), tempUrl.getPath(), tempUrl.getQuery(), tempUrl.getRef()); u = new URI(scheme, tempUrl.getUserInfo(), tempUrl.getHost(), tempUrl.getPort(), tempUrl.getPath(), tempUrl.getQuery(), tempUrl.getRef());
} }
@ -202,11 +202,11 @@ public class ContentBlockerHandler {
if (contentType == null) { if (contentType == null) {
contentType = "text/plain"; contentType = "text/plain";
} else { } else {
String[] contentTypeSplitted = contentType.split(";"); String[] contentTypeSplit = contentType.split(";");
contentType = contentTypeSplitted[0].trim(); contentType = contentTypeSplit[0].trim();
if (encoding == null) { if (encoding == null) {
encoding = (contentTypeSplitted.length > 1 && contentTypeSplitted[1].contains("charset=")) encoding = (contentTypeSplit.length > 1 && contentTypeSplit[1].contains("charset="))
? contentTypeSplitted[1].replace("charset=", "").trim() ? contentTypeSplit[1].replace("charset=", "").trim()
: "utf-8"; : "utf-8";
} }
} }
@ -245,11 +245,11 @@ public class ContentBlockerHandler {
// byte[] dataBytes = response.body().bytes(); // byte[] dataBytes = response.body().bytes();
// InputStream dataStream = new ByteArrayInputStream(dataBytes); // InputStream dataStream = new ByteArrayInputStream(dataBytes);
// //
// String[] contentTypeSplitted = response.header("content-type", "text/plain").split(";"); // String[] contentTypeSplit = response.header("content-type", "text/plain").split(";");
// //
// String contentType = contentTypeSplitted[0].trim(); // String contentType = contentTypeSplit[0].trim();
// String encoding = (contentTypeSplitted.length > 1 && contentTypeSplitted[1].contains("charset=")) // String encoding = (contentTypeSplit.length > 1 && contentTypeSplit[1].contains("charset="))
// ? contentTypeSplitted[1].replace("charset=", "").trim() // ? contentTypeSplit[1].replace("charset=", "").trim()
// : "utf-8"; // : "utf-8";
// //
// response.body().close(); // response.body().close();
@ -297,8 +297,8 @@ public class ContentBlockerHandler {
try { try {
String contentType = urlConnection.getContentType(); String contentType = urlConnection.getContentType();
if (contentType != null) { if (contentType != null) {
String[] contentTypeSplitted = contentType.split(";"); String[] contentTypeSplit = contentType.split(";");
contentType = contentTypeSplitted[0].trim(); contentType = contentTypeSplit[0].trim();
responseResourceType = getResourceTypeFromContentType(contentType); responseResourceType = getResourceTypeFromContentType(contentType);
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -1589,8 +1589,8 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
} }
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1]; var assetPath = assetPathSplit[assetPathSplit.length - 1];
try { try {
var bytes = await rootBundle.load(assetPath); var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List()); html = utf8.decode(bytes.buffer.asUint8List());
@ -1628,8 +1628,8 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase; var assetPathBase;
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/"; assetPathBase = assetPathSplit[0] + "/flutter_assets/";
} }
InAppWebViewSettings? settings = await getSettings(); InAppWebViewSettings? settings = await getSettings();
@ -1745,7 +1745,7 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
String urlIcon, String? rel, String? sizes, bool isManifest) { String urlIcon, String? rel, String? sizes, bool isManifest) {
List<Favicon> favicons = []; List<Favicon> favicons = [];
List<String> urlSplitted = urlIcon.split("/"); List<String> urlSplit = urlIcon.split("/");
if (!_isUrlAbsolute(urlIcon)) { if (!_isUrlAbsolute(urlIcon)) {
if (urlIcon.startsWith("/")) { if (urlIcon.startsWith("/")) {
urlIcon = urlIcon.substring(1); urlIcon = urlIcon.substring(1);
@ -1757,15 +1757,15 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
} }
if (isManifest) { if (isManifest) {
rel = (sizes != null) rel = (sizes != null)
? urlSplitted[urlSplitted.length - 1] ? urlSplit[urlSplit.length - 1]
.replaceFirst("-" + sizes, "") .replaceFirst("-" + sizes, "")
.split(" ")[0] .split(" ")[0]
.split(".")[0] .split(".")[0]
: null; : null;
} }
if (sizes != null && sizes.isNotEmpty && sizes != "any") { if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" "); List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplitted) { for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]); int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]); int height = int.parse(size.split("x")[1]);
favicons.add(Favicon( favicons.add(Favicon(

View File

@ -62,8 +62,8 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
channelDelegate = InAppBrowserChannelDelegate(channel: channel) channelDelegate = InAppBrowserChannelDelegate(channel: channel)
var userScripts: [UserScript] = [] var userScripts: [UserScript] = []
for intialUserScript in initialUserScripts { for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!) userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
} }
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings) let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings)

View File

@ -1,5 +1,5 @@
// //
// CustomeSchemeHandler.swift // CustomSchemeHandler.swift
// flutter_inappwebview // flutter_inappwebview
// //
// Created by Lorenzo Pichilli on 25/10/2019. // Created by Lorenzo Pichilli on 25/10/2019.

View File

@ -29,8 +29,8 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView, Disposable
var userScripts: [UserScript] = [] var userScripts: [UserScript] = []
if let initialUserScripts = initialUserScripts { if let initialUserScripts = initialUserScripts {
for intialUserScript in initialUserScripts { for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!) userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
} }
} }

View File

@ -1982,7 +1982,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
switch action { switch action {
case 0: case 0:
InAppWebView.credentialsProposed = [] InAppWebView.credentialsProposed = []
// used .performDefaultHandling to mantain consistency with Android // used .performDefaultHandling to maintain consistency with Android
// because .cancelAuthenticationChallenge will call webView(_:didFail:withError:) // because .cancelAuthenticationChallenge will call webView(_:didFail:withError:)
completionHandler(.performDefaultHandling, nil) completionHandler(.performDefaultHandling, nil)
//completionHandler(.cancelAuthenticationChallenge, nil) //completionHandler(.cancelAuthenticationChallenge, nil)

View File

@ -62,7 +62,7 @@ public class InAppWebViewManager: ChannelDelegate {
webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in
if error != nil { if error != nil {
print("Error occured to get userAgent") print("Error occurred to get userAgent")
self.webViewForUserAgent = nil self.webViewForUserAgent = nil
completionHandler(nil) completionHandler(nil)
return return

View File

@ -111,7 +111,7 @@ window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync = function(keyword) {
); );
} }
// helper function, recursively removes the highlights in elements and their childs // helper function, recursively removes the highlights in elements and their children
window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) { window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) {
if (element) { if (element) {
if (element.nodeType == 1) { if (element.nodeType == 1) {

View File

@ -49,7 +49,7 @@ extension URLProtectionSpace {
public func toMap () -> [String:Any?] { public func toMap () -> [String:Any?] {
return [ return [
"host": host, "host": host,
"procotol": self.protocol, "protocol": self.protocol,
"realm": realm, "realm": realm,
"port": port, "port": port,
"sslCertificate": sslCertificate?.toMap(), "sslCertificate": sslCertificate?.toMap(),

View File

@ -177,10 +177,10 @@ public class Util {
} }
if let ipv4Range = Range(match.range(at: 2), in: address) { if let ipv4Range = Range(match.range(at: 2), in: address) {
let ipv4 = address[ipv4Range] let ipv4 = address[ipv4Range]
let ipv4Splitted = ipv4.split(separator: ".") let ipv4Split = ipv4.split(separator: ".")
var ipv4Converted = Array(repeating: "0000", count: 4) var ipv4Converted = Array(repeating: "0000", count: 4)
for i in 0...3 { for i in 0...3 {
let byte = Int(ipv4Splitted[i])! let byte = Int(ipv4Split[i])!
let hex = ("0" + String(byte, radix: 16)) let hex = ("0" + String(byte, radix: 16))
var offset = hex.count - 3 var offset = hex.count - 3
offset = offset < 0 ? 0 : offset offset = offset < 0 ? 0 : offset

View File

@ -1585,8 +1585,8 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
} }
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1]; var assetPath = assetPathSplit[assetPathSplit.length - 1];
try { try {
var bytes = await rootBundle.load(assetPath); var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List()); html = utf8.decode(bytes.buffer.asUint8List());
@ -1624,8 +1624,8 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase; var assetPathBase;
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/"; assetPathBase = assetPathSplit[0] + "/flutter_assets/";
} }
InAppWebViewSettings? settings = await getSettings(); InAppWebViewSettings? settings = await getSettings();
@ -1741,7 +1741,7 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
String urlIcon, String? rel, String? sizes, bool isManifest) { String urlIcon, String? rel, String? sizes, bool isManifest) {
List<Favicon> favicons = []; List<Favicon> favicons = [];
List<String> urlSplitted = urlIcon.split("/"); List<String> urlSplit = urlIcon.split("/");
if (!_isUrlAbsolute(urlIcon)) { if (!_isUrlAbsolute(urlIcon)) {
if (urlIcon.startsWith("/")) { if (urlIcon.startsWith("/")) {
urlIcon = urlIcon.substring(1); urlIcon = urlIcon.substring(1);
@ -1753,15 +1753,15 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
} }
if (isManifest) { if (isManifest) {
rel = (sizes != null) rel = (sizes != null)
? urlSplitted[urlSplitted.length - 1] ? urlSplit[urlSplit.length - 1]
.replaceFirst("-" + sizes, "") .replaceFirst("-" + sizes, "")
.split(" ")[0] .split(" ")[0]
.split(".")[0] .split(".")[0]
: null; : null;
} }
if (sizes != null && sizes.isNotEmpty && sizes != "any") { if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" "); List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplitted) { for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]); int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]); int height = int.parse(size.split("x")[1]);
favicons.add(Favicon( favicons.add(Favicon(

View File

@ -1586,8 +1586,8 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
} }
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1]; var assetPath = assetPathSplit[assetPathSplit.length - 1];
try { try {
var bytes = await rootBundle.load(assetPath); var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List()); html = utf8.decode(bytes.buffer.asUint8List());
@ -1625,8 +1625,8 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase; var assetPathBase;
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/"; assetPathBase = assetPathSplit[0] + "/flutter_assets/";
} }
InAppWebViewSettings? settings = await getSettings(); InAppWebViewSettings? settings = await getSettings();
@ -1742,7 +1742,7 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
String urlIcon, String? rel, String? sizes, bool isManifest) { String urlIcon, String? rel, String? sizes, bool isManifest) {
List<Favicon> favicons = []; List<Favicon> favicons = [];
List<String> urlSplitted = urlIcon.split("/"); List<String> urlSplit = urlIcon.split("/");
if (!_isUrlAbsolute(urlIcon)) { if (!_isUrlAbsolute(urlIcon)) {
if (urlIcon.startsWith("/")) { if (urlIcon.startsWith("/")) {
urlIcon = urlIcon.substring(1); urlIcon = urlIcon.substring(1);
@ -1754,15 +1754,15 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
} }
if (isManifest) { if (isManifest) {
rel = (sizes != null) rel = (sizes != null)
? urlSplitted[urlSplitted.length - 1] ? urlSplit[urlSplit.length - 1]
.replaceFirst("-" + sizes, "") .replaceFirst("-" + sizes, "")
.split(" ")[0] .split(" ")[0]
.split(".")[0] .split(".")[0]
: null; : null;
} }
if (sizes != null && sizes.isNotEmpty && sizes != "any") { if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" "); List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplitted) { for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]); int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]); int height = int.parse(size.split("x")[1]);
favicons.add(Favicon( favicons.add(Favicon(

View File

@ -41,8 +41,8 @@ public class InAppBrowserWebViewController: NSViewController, InAppBrowserDelega
channelDelegate = InAppBrowserChannelDelegate(channel: channel) channelDelegate = InAppBrowserChannelDelegate(channel: channel)
var userScripts: [UserScript] = [] var userScripts: [UserScript] = []
for intialUserScript in initialUserScripts { for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!) userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
} }
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings) let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings)

View File

@ -1,5 +1,5 @@
// //
// CustomeSchemeHandler.swift // CustomSchemeHandler.swift
// flutter_inappwebview // flutter_inappwebview
// //
// Created by Lorenzo Pichilli on 25/10/2019. // Created by Lorenzo Pichilli on 25/10/2019.

View File

@ -27,8 +27,8 @@ public class FlutterWebViewController: NSObject, /*FlutterPlatformView,*/ Dispos
var userScripts: [UserScript] = [] var userScripts: [UserScript] = []
if let initialUserScripts = initialUserScripts { if let initialUserScripts = initialUserScripts {
for intialUserScript in initialUserScripts { for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!) userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
} }
} }

View File

@ -1365,7 +1365,7 @@ public class InAppWebView: WKWebView, WKUIDelegate,
switch action { switch action {
case 0: case 0:
InAppWebView.credentialsProposed = [] InAppWebView.credentialsProposed = []
// used .performDefaultHandling to mantain consistency with Android // used .performDefaultHandling to maintain consistency with Android
// because .cancelAuthenticationChallenge will call webView(_:didFail:withError:) // because .cancelAuthenticationChallenge will call webView(_:didFail:withError:)
completionHandler(.performDefaultHandling, nil) completionHandler(.performDefaultHandling, nil)
//completionHandler(.cancelAuthenticationChallenge, nil) //completionHandler(.cancelAuthenticationChallenge, nil)

View File

@ -63,7 +63,7 @@ public class InAppWebViewManager: ChannelDelegate {
webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in
if error != nil { if error != nil {
print("Error occured to get userAgent") print("Error occurred to get userAgent")
self.webViewForUserAgent = nil self.webViewForUserAgent = nil
completionHandler(nil) completionHandler(nil)
return return

View File

@ -111,7 +111,7 @@ window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync = function(keyword) {
); );
} }
// helper function, recursively removes the highlights in elements and their childs // helper function, recursively removes the highlights in elements and their children
window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) { window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) {
if (element) { if (element) {
if (element.nodeType == 1) { if (element.nodeType == 1) {

View File

@ -49,7 +49,7 @@ extension URLProtectionSpace {
public func toMap () -> [String:Any?] { public func toMap () -> [String:Any?] {
return [ return [
"host": host, "host": host,
"procotol": self.protocol, "protocol": self.protocol,
"realm": realm, "realm": realm,
"port": port, "port": port,
"sslCertificate": sslCertificate?.toMap(), "sslCertificate": sslCertificate?.toMap(),

View File

@ -106,10 +106,10 @@ public class Util {
} }
if let ipv4Range = Range(match.range(at: 2), in: address) { if let ipv4Range = Range(match.range(at: 2), in: address) {
let ipv4 = address[ipv4Range] let ipv4 = address[ipv4Range]
let ipv4Splitted = ipv4.split(separator: ".") let ipv4Split = ipv4.split(separator: ".")
var ipv4Converted = Array(repeating: "0000", count: 4) var ipv4Converted = Array(repeating: "0000", count: 4)
for i in 0...3 { for i in 0...3 {
let byte = Int(ipv4Splitted[i])! let byte = Int(ipv4Split[i])!
let hex = ("0" + String(byte, radix: 16)) let hex = ("0" + String(byte, radix: 16))
var offset = hex.count - 3 var offset = hex.count - 3
offset = offset < 0 ? 0 : offset offset = offset < 0 ? 0 : offset

View File

@ -14,7 +14,7 @@ class ConsoleMessage_ {
///Console message ///Console message
String message; String message;
///Console messsage level ///Console message level
ConsoleMessageLevel_ messageLevel; ConsoleMessageLevel_ messageLevel;
ConsoleMessage_( ConsoleMessage_(

View File

@ -14,7 +14,7 @@ class ConsoleMessage {
///Console message ///Console message
String message; String message;
///Console messsage level ///Console message level
ConsoleMessageLevel messageLevel; ConsoleMessageLevel messageLevel;
ConsoleMessage( ConsoleMessage(
{this.message = "", this.messageLevel = ConsoleMessageLevel.LOG}); {this.message = "", this.messageLevel = ConsoleMessageLevel.LOG});

View File

@ -261,8 +261,8 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
} }
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1]; var assetPath = assetPathSplit[assetPathSplit.length - 1];
try { try {
var bytes = await rootBundle.load(assetPath); var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List()); html = utf8.decode(bytes.buffer.asUint8List());
@ -291,8 +291,8 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase; var assetPathBase;
if (webviewUrl.isScheme("file")) { if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/"); var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/"; assetPathBase = assetPathSplit[0] + "/flutter_assets/";
} }
InAppWebViewSettings? settings = await getSettings(); InAppWebViewSettings? settings = await getSettings();
@ -354,7 +354,7 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
String urlIcon, String? rel, String? sizes, bool isManifest) { String urlIcon, String? rel, String? sizes, bool isManifest) {
List<Favicon> favicons = []; List<Favicon> favicons = [];
List<String> urlSplitted = urlIcon.split("/"); List<String> urlSplit = urlIcon.split("/");
if (!_isUrlAbsolute(urlIcon)) { if (!_isUrlAbsolute(urlIcon)) {
if (urlIcon.startsWith("/")) { if (urlIcon.startsWith("/")) {
urlIcon = urlIcon.substring(1); urlIcon = urlIcon.substring(1);
@ -366,15 +366,15 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
} }
if (isManifest) { if (isManifest) {
rel = (sizes != null) rel = (sizes != null)
? urlSplitted[urlSplitted.length - 1] ? urlSplit[urlSplit.length - 1]
.replaceFirst("-" + sizes, "") .replaceFirst("-" + sizes, "")
.split(" ")[0] .split(" ")[0]
.split(".")[0] .split(".")[0]
: null; : null;
} }
if (sizes != null && sizes.isNotEmpty && sizes != "any") { if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" "); List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplitted) { for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]); int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]); int height = int.parse(size.split("x")[1]);
favicons.add(Favicon( favicons.add(Favicon(