code formatting

This commit is contained in:
Lorenzo Pichilli 2021-03-08 10:23:20 +01:00
parent 659c524908
commit 124d2ae0de
1 changed files with 12 additions and 6 deletions

View File

@ -1908,7 +1908,8 @@ class InAppWebViewController {
///
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkusercontentcontroller/1537448-adduserscript
Future<void> addUserScript({required UserScript userScript}) async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('userScript', () => userScript.toMap());
@ -1924,7 +1925,8 @@ class InAppWebViewController {
///There isn't any way to add/remove user scripts specific to iOS window WebViews.
///This is a limitation of the native iOS WebKit APIs.
Future<void> addUserScripts({required List<UserScript> userScripts}) async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
for (var i = 0; i < userScripts.length; i++) {
await addUserScript(userScript: userScripts[i]);
@ -1939,7 +1941,8 @@ class InAppWebViewController {
///There isn't any way to add/remove user scripts specific to iOS window WebViews.
///This is a limitation of the native iOS WebKit APIs.
Future<bool> removeUserScript({required UserScript userScript}) async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
var index = _userScripts.indexOf(userScript);
if (index == -1) {
@ -1962,7 +1965,8 @@ class InAppWebViewController {
///There isn't any way to add/remove user scripts specific to iOS window WebViews.
///This is a limitation of the native iOS WebKit APIs.
Future<void> removeUserScriptsByGroupName({required String groupName}) async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('groupName', () => groupName);
@ -1977,7 +1981,8 @@ class InAppWebViewController {
///This is a limitation of the native iOS WebKit APIs.
Future<void> removeUserScripts(
{required List<UserScript> userScripts}) async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
for (var i = 0; i < userScripts.length; i++) {
await removeUserScript(userScript: userScripts[i]);
@ -1992,7 +1997,8 @@ class InAppWebViewController {
///
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkusercontentcontroller/1536540-removealluserscripts
Future<void> removeAllUserScripts() async {
assert(_webview?.windowId == null || defaultTargetPlatform != TargetPlatform.iOS);
assert(_webview?.windowId == null ||
defaultTargetPlatform != TargetPlatform.iOS);
_userScripts.clear();
Map<String, dynamic> args = <String, dynamic>{};