updated debugLoggingSettings references, dart format

This commit is contained in:
Lorenzo Pichilli 2023-11-23 16:06:50 +01:00
parent 9cb8b3af26
commit 0b0869ce2a
104 changed files with 631 additions and 740 deletions

View File

@ -16,14 +16,13 @@ void setGetDelete() {
final Completer<String> pageLoaded = Completer<String>(); final Completer<String> pageLoaded = Completer<String>();
var headlessWebView = new HeadlessInAppWebView( var headlessWebView = new HeadlessInAppWebView(
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1), initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
onWebViewCreated: (controller) { onWebViewCreated: (controller) {
controllerCompleter.complete(controller); controllerCompleter.complete(controller);
}, },
onLoadStop: (controller, url) async { onLoadStop: (controller, url) async {
pageLoaded.complete(url!.toString()); pageLoaded.complete(url!.toString());
} });
);
if (defaultTargetPlatform == TargetPlatform.macOS) { if (defaultTargetPlatform == TargetPlatform.macOS) {
await headlessWebView.run(); await headlessWebView.run();

View File

@ -14,14 +14,13 @@ void convertToInAppWebView() {
final Completer<void> pageLoaded = Completer<void>(); final Completer<void> pageLoaded = Completer<void>();
var headlessWebView = new HeadlessInAppWebView( var headlessWebView = new HeadlessInAppWebView(
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1), initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
onWebViewCreated: (controller) { onWebViewCreated: (controller) {
controllerCompleter.complete(controller); controllerCompleter.complete(controller);
}, },
onLoadStop: (controller, url) async { onLoadStop: (controller, url) async {
pageLoaded.complete(); pageLoaded.complete();
} });
);
await headlessWebView.run(); await headlessWebView.run();
expect(headlessWebView.isRunning(), true); expect(headlessWebView.isRunning(), true);

View File

@ -15,14 +15,13 @@ void runAndDispose() {
final Completer<void> pageLoaded = Completer<void>(); final Completer<void> pageLoaded = Completer<void>();
var headlessWebView = new HeadlessInAppWebView( var headlessWebView = new HeadlessInAppWebView(
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1), initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
onWebViewCreated: (controller) { onWebViewCreated: (controller) {
controllerCompleter.complete(controller); controllerCompleter.complete(controller);
}, },
onLoadStop: (controller, url) async { onLoadStop: (controller, url) async {
pageLoaded.complete(); pageLoaded.complete();
} });
);
await headlessWebView.run(); await headlessWebView.run();
expect(headlessWebView.isRunning(), true); expect(headlessWebView.isRunning(), true);

View File

@ -19,17 +19,21 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); IntegrationTestWidgetsFlutterBinding.ensureInitialized();
PlatformInAppWebViewController.debugLoggingSettings.usePrint = true; PlatformInAppWebViewController.debugLoggingSettings.usePrint = true;
PlatformInAppWebViewController.debugLoggingSettings.maxLogMessageLength = 7000; PlatformInAppWebViewController.debugLoggingSettings.maxLogMessageLength =
7000;
PlatformInAppBrowser.debugLoggingSettings.usePrint = true; PlatformInAppBrowser.debugLoggingSettings.usePrint = true;
PlatformInAppBrowser.debugLoggingSettings.maxLogMessageLength = 7000; PlatformInAppBrowser.debugLoggingSettings.maxLogMessageLength = 7000;
PlatformChromeSafariBrowser.debugLoggingSettings.usePrint = true; PlatformChromeSafariBrowser.debugLoggingSettings.usePrint = true;
PlatformChromeSafariBrowser.debugLoggingSettings.maxLogMessageLength = 7000; PlatformChromeSafariBrowser.debugLoggingSettings.maxLogMessageLength = 7000;
PlatformWebAuthenticationSession.debugLoggingSettings.usePrint = true; PlatformWebAuthenticationSession.debugLoggingSettings.usePrint = true;
PlatformWebAuthenticationSession.debugLoggingSettings.maxLogMessageLength = 7000; PlatformWebAuthenticationSession.debugLoggingSettings.maxLogMessageLength =
7000;
PlatformPullToRefreshController.debugLoggingSettings.usePrint = true; PlatformPullToRefreshController.debugLoggingSettings.usePrint = true;
PlatformPullToRefreshController.debugLoggingSettings.maxLogMessageLength = 7000; PlatformPullToRefreshController.debugLoggingSettings.maxLogMessageLength =
7000;
PlatformFindInteractionController.debugLoggingSettings.usePrint = true; PlatformFindInteractionController.debugLoggingSettings.usePrint = true;
PlatformFindInteractionController.debugLoggingSettings.maxLogMessageLength = 7000; PlatformFindInteractionController.debugLoggingSettings.maxLogMessageLength =
7000;
process_global_config_tests.main(); process_global_config_tests.main();
in_app_webview_tests.main(); in_app_webview_tests.main();

View File

@ -36,24 +36,22 @@ class AndroidChromeSafariBrowserCreationParams
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android ///- Android
///- iOS ///- iOS
class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser with ChannelController { class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
///Debug settings. with ChannelController {
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
///View ID used internally. ///View ID used internally.
final String id = IdGenerator.generate(); final String id = IdGenerator.generate();
/// Constructs a [AndroidChromeSafariBrowser]. /// Constructs a [AndroidChromeSafariBrowser].
AndroidChromeSafariBrowser(PlatformChromeSafariBrowserCreationParams params) AndroidChromeSafariBrowser(PlatformChromeSafariBrowserCreationParams params)
: super.implementation( : super.implementation(
params is AndroidChromeSafariBrowserCreationParams params is AndroidChromeSafariBrowserCreationParams
? params ? params
: AndroidChromeSafariBrowserCreationParams : AndroidChromeSafariBrowserCreationParams
.fromPlatformChromeSafariBrowserCreationParams(params), .fromPlatformChromeSafariBrowserCreationParams(params),
); );
static final AndroidChromeSafariBrowser _staticValue = static final AndroidChromeSafariBrowser _staticValue =
AndroidChromeSafariBrowser(AndroidChromeSafariBrowserCreationParams()); AndroidChromeSafariBrowser(AndroidChromeSafariBrowserCreationParams());
factory AndroidChromeSafariBrowser.static() { factory AndroidChromeSafariBrowser.static() {
return _staticValue; return _staticValue;
@ -77,7 +75,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser with Channe
debugLog( debugLog(
className: this.runtimeType.toString(), className: this.runtimeType.toString(),
id: id, id: id,
debugLoggingSettings: AndroidChromeSafariBrowser.debugLoggingSettings, debugLoggingSettings: PlatformChromeSafariBrowser.debugLoggingSettings,
method: method, method: method,
args: args); args: args);
} }
@ -113,7 +111,8 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser with Channe
? WebUri(call.arguments["requestedOrigin"]) ? WebUri(call.arguments["requestedOrigin"])
: null; : null;
final bool result = call.arguments["result"]; final bool result = call.arguments["result"];
eventHandler?.onRelationshipValidationResult(relation, requestedOrigin, result); eventHandler?.onRelationshipValidationResult(
relation, requestedOrigin, result);
break; break;
case "onWillOpenInBrowser": case "onWillOpenInBrowser":
eventHandler?.onWillOpenInBrowser(); eventHandler?.onWillOpenInBrowser();

View File

@ -189,13 +189,12 @@ class AndroidCookieManager extends PlatformCookieManager
final setCookieCompleter = Completer<void>(); final setCookieCompleter = Completer<void>();
final headlessWebView = final headlessWebView =
AndroidHeadlessInAppWebView(AndroidHeadlessInAppWebViewCreationParams( AndroidHeadlessInAppWebView(AndroidHeadlessInAppWebViewCreationParams(
initialUrlRequest: URLRequest(url: url), initialUrlRequest: URLRequest(url: url),
onLoadStop: (controller, url) async { onLoadStop: (controller, url) async {
await controller.evaluateJavascript( await controller.evaluateJavascript(
source: 'document.cookie="$cookieValue"'); source: 'document.cookie="$cookieValue"');
setCookieCompleter.complete(); setCookieCompleter.complete();
} }));
));
await headlessWebView.run(); await headlessWebView.run();
await setCookieCompleter.future; await setCookieCompleter.future;
await headlessWebView.dispose(); await headlessWebView.dispose();

View File

@ -30,9 +30,6 @@ class AndroidFindInteractionControllerCreationParams
///- MacOS ///- MacOS
class AndroidFindInteractionController extends PlatformFindInteractionController class AndroidFindInteractionController extends PlatformFindInteractionController
with ChannelController { with ChannelController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [AndroidFindInteractionController]. /// Constructs a [AndroidFindInteractionController].
AndroidFindInteractionController( AndroidFindInteractionController(
PlatformFindInteractionControllerCreationParams params) PlatformFindInteractionControllerCreationParams params)
@ -47,7 +44,7 @@ class AndroidFindInteractionController extends PlatformFindInteractionController
debugLog( debugLog(
className: this.runtimeType.toString(), className: this.runtimeType.toString(),
debugLoggingSettings: debugLoggingSettings:
AndroidFindInteractionController.debugLoggingSettings, PlatformFindInteractionController.debugLoggingSettings,
method: method, method: method,
args: args); args: args);
} }

View File

@ -1 +1,2 @@
export 'find_interaction_controller.dart' hide InternalFindInteractionController; export 'find_interaction_controller.dart'
hide InternalFindInteractionController;

View File

@ -54,9 +54,6 @@ class AndroidInAppBrowserCreationParams
///- iOS ///- iOS
///- MacOS ///- MacOS
class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController { class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
///View ID used internally. ///View ID used internally.
final String id = IdGenerator.generate(); final String id = IdGenerator.generate();

View File

@ -416,7 +416,8 @@ class AndroidInAppWebViewWidget extends PlatformInAppWebViewWidget {
method: "onWebViewCreated", method: "onWebViewCreated",
args: []); args: []);
if (_androidParams.onWebViewCreated != null) { if (_androidParams.onWebViewCreated != null) {
_androidParams.onWebViewCreated!(params.controllerFromPlatform?.call(_controller!) ?? _controller!); _androidParams.onWebViewCreated!(
params.controllerFromPlatform?.call(_controller!) ?? _controller!);
} }
} }

View File

@ -4,14 +4,14 @@ export 'in_app_browser/main.dart';
export 'chrome_safari_browser/main.dart'; export 'chrome_safari_browser/main.dart';
export 'web_storage/main.dart'; export 'web_storage/main.dart';
export 'cookie_manager.dart' hide InternalCookieManager; export 'cookie_manager.dart' hide InternalCookieManager;
export 'http_auth_credentials_database.dart' hide InternalHttpAuthCredentialDatabase; export 'http_auth_credentials_database.dart'
hide InternalHttpAuthCredentialDatabase;
export 'pull_to_refresh/main.dart'; export 'pull_to_refresh/main.dart';
export 'web_message/main.dart'; export 'web_message/main.dart';
export 'print_job/main.dart'; export 'print_job/main.dart';
export 'find_interaction/main.dart'; export 'find_interaction/main.dart';
export 'service_worker_controller.dart'; export 'service_worker_controller.dart';
export 'webview_feature.dart' export 'webview_feature.dart' hide InternalWebViewFeature;
hide InternalWebViewFeature;
export 'proxy_controller.dart' hide InternalProxyController; export 'proxy_controller.dart' hide InternalProxyController;
export 'webview_asset_loader.dart'; export 'webview_asset_loader.dart';
export 'tracing_controller.dart' hide InternalTracingController; export 'tracing_controller.dart' hide InternalTracingController;

View File

@ -3,8 +3,8 @@ import 'package:flutter/services.dart';
///Platform native utilities ///Platform native utilities
class PlatformUtil { class PlatformUtil {
static PlatformUtil? _instance; static PlatformUtil? _instance;
static const MethodChannel _channel = MethodChannel( static const MethodChannel _channel =
'com.pichillilorenzo/flutter_inappwebview_platformutil'); MethodChannel('com.pichillilorenzo/flutter_inappwebview_platformutil');
PlatformUtil._(); PlatformUtil._();

View File

@ -125,4 +125,3 @@ class AndroidPrintJobController extends PlatformPrintJobController
disposeChannel(); disposeChannel();
} }
} }

View File

@ -13,10 +13,10 @@ class AndroidProcessGlobalConfigCreationParams
extends PlatformProcessGlobalConfigCreationParams { extends PlatformProcessGlobalConfigCreationParams {
/// Creates a new [AndroidProcessGlobalConfigCreationParams] instance. /// Creates a new [AndroidProcessGlobalConfigCreationParams] instance.
const AndroidProcessGlobalConfigCreationParams( const AndroidProcessGlobalConfigCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformProcessGlobalConfigCreationParams params, PlatformProcessGlobalConfigCreationParams params,
) : super(); ) : super();
/// Creates a [AndroidProcessGlobalConfigCreationParams] instance based on [PlatformProcessGlobalConfigCreationParams]. /// Creates a [AndroidProcessGlobalConfigCreationParams] instance based on [PlatformProcessGlobalConfigCreationParams].
factory AndroidProcessGlobalConfigCreationParams.fromPlatformProcessGlobalConfigCreationParams( factory AndroidProcessGlobalConfigCreationParams.fromPlatformProcessGlobalConfigCreationParams(
@ -47,15 +47,16 @@ class AndroidProcessGlobalConfigCreationParams
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig)) ///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig))
class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with ChannelController { class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig
with ChannelController {
/// Creates a new [AndroidProcessGlobalConfig]. /// Creates a new [AndroidProcessGlobalConfig].
AndroidProcessGlobalConfig(PlatformProcessGlobalConfigCreationParams params) AndroidProcessGlobalConfig(PlatformProcessGlobalConfigCreationParams params)
: super.implementation( : super.implementation(
params is AndroidProcessGlobalConfigCreationParams params is AndroidProcessGlobalConfigCreationParams
? params ? params
: AndroidProcessGlobalConfigCreationParams : AndroidProcessGlobalConfigCreationParams
.fromPlatformProcessGlobalConfigCreationParams(params), .fromPlatformProcessGlobalConfigCreationParams(params),
) { ) {
channel = const MethodChannel( channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_processglobalconfig'); 'com.pichillilorenzo/flutter_inappwebview_processglobalconfig');
handler = handleMethod; handler = handleMethod;
@ -70,8 +71,9 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
} }
static AndroidProcessGlobalConfig _init() { static AndroidProcessGlobalConfig _init() {
_instance = AndroidProcessGlobalConfig(AndroidProcessGlobalConfigCreationParams( _instance = AndroidProcessGlobalConfig(
const PlatformProcessGlobalConfigCreationParams())); AndroidProcessGlobalConfigCreationParams(
const PlatformProcessGlobalConfigCreationParams()));
return _instance!; return _instance!;
} }
@ -99,4 +101,3 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
extension InternalProcessGlobalConfig on AndroidProcessGlobalConfig { extension InternalProcessGlobalConfig on AndroidProcessGlobalConfig {
get handleMethod => _handleMethod; get handleMethod => _handleMethod;
} }

View File

@ -13,10 +13,10 @@ class AndroidProxyControllerCreationParams
extends PlatformProxyControllerCreationParams { extends PlatformProxyControllerCreationParams {
/// Creates a new [AndroidProxyControllerCreationParams] instance. /// Creates a new [AndroidProxyControllerCreationParams] instance.
const AndroidProxyControllerCreationParams( const AndroidProxyControllerCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformProxyControllerCreationParams params, PlatformProxyControllerCreationParams params,
) : super(); ) : super();
/// Creates a [AndroidProxyControllerCreationParams] instance based on [PlatformProxyControllerCreationParams]. /// Creates a [AndroidProxyControllerCreationParams] instance based on [PlatformProxyControllerCreationParams].
factory AndroidProxyControllerCreationParams.fromPlatformProxyControllerCreationParams( factory AndroidProxyControllerCreationParams.fromPlatformProxyControllerCreationParams(
@ -35,15 +35,16 @@ class AndroidProxyControllerCreationParams
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController)) ///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController))
class AndroidProxyController extends PlatformProxyController with ChannelController { class AndroidProxyController extends PlatformProxyController
with ChannelController {
/// Creates a new [AndroidProxyController]. /// Creates a new [AndroidProxyController].
AndroidProxyController(PlatformProxyControllerCreationParams params) AndroidProxyController(PlatformProxyControllerCreationParams params)
: super.implementation( : super.implementation(
params is AndroidProxyControllerCreationParams params is AndroidProxyControllerCreationParams
? params ? params
: AndroidProxyControllerCreationParams : AndroidProxyControllerCreationParams
.fromPlatformProxyControllerCreationParams(params), .fromPlatformProxyControllerCreationParams(params),
) { ) {
channel = const MethodChannel( channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_proxycontroller'); 'com.pichillilorenzo/flutter_inappwebview_proxycontroller');
handler = handleMethod; handler = handleMethod;

View File

@ -39,9 +39,6 @@ class AndroidPullToRefreshControllerCreationParams
///- iOS ///- iOS
class AndroidPullToRefreshController extends PlatformPullToRefreshController class AndroidPullToRefreshController extends PlatformPullToRefreshController
with ChannelController { with ChannelController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [AndroidPullToRefreshController]. /// Constructs a [AndroidPullToRefreshController].
AndroidPullToRefreshController( AndroidPullToRefreshController(
PlatformPullToRefreshControllerCreationParams params) PlatformPullToRefreshControllerCreationParams params)
@ -56,7 +53,7 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
debugLog( debugLog(
className: this.runtimeType.toString(), className: this.runtimeType.toString(),
debugLoggingSettings: debugLoggingSettings:
AndroidPullToRefreshController.debugLoggingSettings, PlatformPullToRefreshController.debugLoggingSettings,
method: method, method: method,
args: args); args: args);
} }

View File

@ -114,7 +114,8 @@ class AndroidServiceWorkerController extends PlatformServiceWorkerController
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowContentAccess() ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowContentAccess()
Future<bool> getAllowContentAccess() async { Future<bool> getAllowContentAccess() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('getAllowContentAccess', args) ?? false; return await channel?.invokeMethod<bool>('getAllowContentAccess', args) ??
false;
} }
///Gets whether Service Workers support file access. ///Gets whether Service Workers support file access.

View File

@ -13,10 +13,10 @@ class AndroidTracingControllerCreationParams
extends PlatformTracingControllerCreationParams { extends PlatformTracingControllerCreationParams {
/// Creates a new [AndroidTracingControllerCreationParams] instance. /// Creates a new [AndroidTracingControllerCreationParams] instance.
const AndroidTracingControllerCreationParams( const AndroidTracingControllerCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformTracingControllerCreationParams params, PlatformTracingControllerCreationParams params,
) : super(); ) : super();
/// Creates a [AndroidTracingControllerCreationParams] instance based on [PlatformTracingControllerCreationParams]. /// Creates a [AndroidTracingControllerCreationParams] instance based on [PlatformTracingControllerCreationParams].
factory AndroidTracingControllerCreationParams.fromPlatformTracingControllerCreationParams( factory AndroidTracingControllerCreationParams.fromPlatformTracingControllerCreationParams(
@ -34,15 +34,16 @@ class AndroidTracingControllerCreationParams
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController)) ///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController))
class AndroidTracingController extends PlatformTracingController with ChannelController { class AndroidTracingController extends PlatformTracingController
with ChannelController {
/// Creates a new [AndroidTracingController]. /// Creates a new [AndroidTracingController].
AndroidTracingController(PlatformTracingControllerCreationParams params) AndroidTracingController(PlatformTracingControllerCreationParams params)
: super.implementation( : super.implementation(
params is AndroidTracingControllerCreationParams params is AndroidTracingControllerCreationParams
? params ? params
: AndroidTracingControllerCreationParams : AndroidTracingControllerCreationParams
.fromPlatformTracingControllerCreationParams(params), .fromPlatformTracingControllerCreationParams(params),
) { ) {
channel = const MethodChannel( channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_tracingcontroller'); 'com.pichillilorenzo/flutter_inappwebview_tracingcontroller');
handler = handleMethod; handler = handleMethod;

View File

@ -64,11 +64,9 @@ class AndroidWebMessageChannel extends PlatformWebMessageChannel
return _staticValue; return _staticValue;
} }
AndroidWebMessagePort get _androidPort1 => AndroidWebMessagePort get _androidPort1 => port1 as AndroidWebMessagePort;
port1 as AndroidWebMessagePort;
AndroidWebMessagePort get _androidPort2 => AndroidWebMessagePort get _androidPort2 => port2 as AndroidWebMessagePort;
port2 as AndroidWebMessagePort;
static AndroidWebMessageChannel? _fromMap(Map<String, dynamic>? map) { static AndroidWebMessageChannel? _fromMap(Map<String, dynamic>? map) {
if (map == null) { if (map == null) {

View File

@ -85,8 +85,7 @@ class AndroidWebMessageListener extends PlatformWebMessageListener
? WebUri(call.arguments["sourceOrigin"]) ? WebUri(call.arguments["sourceOrigin"])
: null; : null;
bool isMainFrame = call.arguments["isMainFrame"]; bool isMainFrame = call.arguments["isMainFrame"];
onPostMessage!( onPostMessage!(message, sourceOrigin, isMainFrame, _replyProxy!);
message, sourceOrigin, isMainFrame, _replyProxy!);
} }
break; break;
default: default:

View File

@ -12,16 +12,14 @@ import 'web_message_channel.dart';
class AndroidWebMessagePortCreationParams class AndroidWebMessagePortCreationParams
extends PlatformWebMessagePortCreationParams { extends PlatformWebMessagePortCreationParams {
/// Creates a new [AndroidWebMessagePortCreationParams] instance. /// Creates a new [AndroidWebMessagePortCreationParams] instance.
const AndroidWebMessagePortCreationParams( const AndroidWebMessagePortCreationParams({required super.index});
{required super.index});
/// Creates a [AndroidWebMessagePortCreationParams] instance based on [PlatformWebMessagePortCreationParams]. /// Creates a [AndroidWebMessagePortCreationParams] instance based on [PlatformWebMessagePortCreationParams].
factory AndroidWebMessagePortCreationParams.fromPlatformWebMessagePortCreationParams( factory AndroidWebMessagePortCreationParams.fromPlatformWebMessagePortCreationParams(
// Recommended placeholder to prevent being broken by platform interface. // Recommended placeholder to prevent being broken by platform interface.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformWebMessagePortCreationParams params) { PlatformWebMessagePortCreationParams params) {
return AndroidWebMessagePortCreationParams( return AndroidWebMessagePortCreationParams(index: params.index);
index: params.index);
} }
@override @override
@ -49,19 +47,17 @@ class AndroidWebMessagePortCreationParams
/// ///
///It is possible to transfer both ports of a channel to JavaScript, for example for communication between subframes. ///It is possible to transfer both ports of a channel to JavaScript, for example for communication between subframes.
class AndroidWebMessagePort extends PlatformWebMessagePort { class AndroidWebMessagePort extends PlatformWebMessagePort {
WebMessageCallback? _onMessage; WebMessageCallback? _onMessage;
late AndroidWebMessageChannel _webMessageChannel; late AndroidWebMessageChannel _webMessageChannel;
/// Constructs a [AndroidWebMessagePort]. /// Constructs a [AndroidWebMessagePort].
AndroidWebMessagePort( AndroidWebMessagePort(PlatformWebMessagePortCreationParams params)
PlatformWebMessagePortCreationParams params)
: super.implementation( : super.implementation(
params is AndroidWebMessagePortCreationParams params is AndroidWebMessagePortCreationParams
? params ? params
: AndroidWebMessagePortCreationParams : AndroidWebMessagePortCreationParams
.fromPlatformWebMessagePortCreationParams(params), .fromPlatformWebMessagePortCreationParams(params),
); );
///Sets a callback to receive message events on the main thread. ///Sets a callback to receive message events on the main thread.
Future<void> setWebMessageCallback(WebMessageCallback? onMessage) async { Future<void> setWebMessageCallback(WebMessageCallback? onMessage) async {

View File

@ -253,7 +253,8 @@ class AndroidLocalStorageCreationParams
///Class that provides methods to manage the JavaScript `window.localStorage` object. ///Class that provides methods to manage the JavaScript `window.localStorage` object.
///It used by [AndroidWebStorage]. ///It used by [AndroidWebStorage].
class AndroidLocalStorage extends AndroidStorage implements PlatformLocalStorage { class AndroidLocalStorage extends AndroidStorage
implements PlatformLocalStorage {
/// Constructs a [AndroidLocalStorage]. /// Constructs a [AndroidLocalStorage].
AndroidLocalStorage(PlatformLocalStorageCreationParams params) AndroidLocalStorage(PlatformLocalStorageCreationParams params)
: super( : super(
@ -292,7 +293,8 @@ class AndroidSessionStorageCreationParams
///Class that provides methods to manage the JavaScript `window.sessionStorage` object. ///Class that provides methods to manage the JavaScript `window.sessionStorage` object.
///It used by [AndroidWebStorage]. ///It used by [AndroidWebStorage].
class AndroidSessionStorage extends AndroidStorage implements PlatformSessionStorage { class AndroidSessionStorage extends AndroidStorage
implements PlatformSessionStorage {
/// Constructs a [AndroidSessionStorage]. /// Constructs a [AndroidSessionStorage].
AndroidSessionStorage(PlatformSessionStorageCreationParams params) AndroidSessionStorage(PlatformSessionStorageCreationParams params)
: super( : super(

View File

@ -27,8 +27,7 @@ class AndroidPathHandlerCreationParams
///A handler that produces responses for a registered path. ///A handler that produces responses for a registered path.
/// ///
///Implement this interface to handle other use-cases according to your app's needs. ///Implement this interface to handle other use-cases according to your app's needs.
class AndroidPathHandler extends PlatformPathHandler class AndroidPathHandler extends PlatformPathHandler with ChannelController {
with ChannelController {
/// Creates a new [AndroidPathHandler]. /// Creates a new [AndroidPathHandler].
AndroidPathHandler(PlatformPathHandlerCreationParams params) AndroidPathHandler(PlatformPathHandlerCreationParams params)
: super.implementation( : super.implementation(
@ -90,10 +89,10 @@ class AndroidAssetsPathHandlerCreationParams
extends PlatformAssetsPathHandlerCreationParams { extends PlatformAssetsPathHandlerCreationParams {
/// Creates a new [AndroidAssetsPathHandlerCreationParams] instance. /// Creates a new [AndroidAssetsPathHandlerCreationParams] instance.
AndroidAssetsPathHandlerCreationParams( AndroidAssetsPathHandlerCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformAssetsPathHandlerCreationParams params, PlatformAssetsPathHandlerCreationParams params,
) : super(params); ) : super(params);
/// Creates a [AndroidAssetsPathHandlerCreationParams] instance based on [PlatformAssetsPathHandlerCreationParams]. /// Creates a [AndroidAssetsPathHandlerCreationParams] instance based on [PlatformAssetsPathHandlerCreationParams].
factory AndroidAssetsPathHandlerCreationParams.fromPlatformAssetsPathHandlerCreationParams( factory AndroidAssetsPathHandlerCreationParams.fromPlatformAssetsPathHandlerCreationParams(
@ -115,15 +114,16 @@ class AndroidAssetsPathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-). ///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions. ///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default. ///If the file does not have a recognised extension, `text/plain` will be used by default.
class AndroidAssetsPathHandler extends AndroidPathHandler implements PlatformAssetsPathHandler { class AndroidAssetsPathHandler extends AndroidPathHandler
implements PlatformAssetsPathHandler {
/// Constructs a [AndroidAssetsPathHandler]. /// Constructs a [AndroidAssetsPathHandler].
AndroidAssetsPathHandler(PlatformAssetsPathHandlerCreationParams params) AndroidAssetsPathHandler(PlatformAssetsPathHandlerCreationParams params)
: super( : super(
params is AndroidAssetsPathHandlerCreationParams params is AndroidAssetsPathHandlerCreationParams
? params ? params
: AndroidAssetsPathHandlerCreationParams : AndroidAssetsPathHandlerCreationParams
.fromPlatformAssetsPathHandlerCreationParams(params), .fromPlatformAssetsPathHandlerCreationParams(params),
); );
} }
/// Object specifying creation parameters for creating a [AndroidResourcesPathHandler]. /// Object specifying creation parameters for creating a [AndroidResourcesPathHandler].
@ -136,10 +136,10 @@ class AndroidResourcesPathHandlerCreationParams
extends PlatformResourcesPathHandlerCreationParams { extends PlatformResourcesPathHandlerCreationParams {
/// Creates a new [AndroidResourcesPathHandlerCreationParams] instance. /// Creates a new [AndroidResourcesPathHandlerCreationParams] instance.
AndroidResourcesPathHandlerCreationParams( AndroidResourcesPathHandlerCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformResourcesPathHandlerCreationParams params, PlatformResourcesPathHandlerCreationParams params,
) : super(params); ) : super(params);
/// Creates a [AndroidResourcesPathHandlerCreationParams] instance based on [PlatformResourcesPathHandlerCreationParams]. /// Creates a [AndroidResourcesPathHandlerCreationParams] instance based on [PlatformResourcesPathHandlerCreationParams].
factory AndroidResourcesPathHandlerCreationParams.fromPlatformResourcesPathHandlerCreationParams( factory AndroidResourcesPathHandlerCreationParams.fromPlatformResourcesPathHandlerCreationParams(
@ -161,15 +161,16 @@ class AndroidResourcesPathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-). ///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions. ///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default. ///If the file does not have a recognised extension, `text/plain` will be used by default.
class AndroidResourcesPathHandler extends AndroidPathHandler implements PlatformResourcesPathHandler { class AndroidResourcesPathHandler extends AndroidPathHandler
implements PlatformResourcesPathHandler {
/// Constructs a [AndroidResourcesPathHandler]. /// Constructs a [AndroidResourcesPathHandler].
AndroidResourcesPathHandler(PlatformResourcesPathHandlerCreationParams params) AndroidResourcesPathHandler(PlatformResourcesPathHandlerCreationParams params)
: super( : super(
params is AndroidResourcesPathHandlerCreationParams params is AndroidResourcesPathHandlerCreationParams
? params ? params
: AndroidResourcesPathHandlerCreationParams : AndroidResourcesPathHandlerCreationParams
.fromPlatformResourcesPathHandlerCreationParams(params), .fromPlatformResourcesPathHandlerCreationParams(params),
); );
} }
/// Object specifying creation parameters for creating a [AndroidInternalStoragePathHandler]. /// Object specifying creation parameters for creating a [AndroidInternalStoragePathHandler].
@ -182,10 +183,10 @@ class AndroidInternalStoragePathHandlerCreationParams
extends PlatformInternalStoragePathHandlerCreationParams { extends PlatformInternalStoragePathHandlerCreationParams {
/// Creates a new [AndroidInternalStoragePathHandlerCreationParams] instance. /// Creates a new [AndroidInternalStoragePathHandlerCreationParams] instance.
AndroidInternalStoragePathHandlerCreationParams( AndroidInternalStoragePathHandlerCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformInternalStoragePathHandlerCreationParams params, PlatformInternalStoragePathHandlerCreationParams params,
) : super(params, directory: params.directory); ) : super(params, directory: params.directory);
/// Creates a [AndroidInternalStoragePathHandlerCreationParams] instance based on [PlatformInternalStoragePathHandlerCreationParams]. /// Creates a [AndroidInternalStoragePathHandlerCreationParams] instance based on [PlatformInternalStoragePathHandlerCreationParams].
factory AndroidInternalStoragePathHandlerCreationParams.fromPlatformInternalStoragePathHandlerCreationParams( factory AndroidInternalStoragePathHandlerCreationParams.fromPlatformInternalStoragePathHandlerCreationParams(
@ -212,15 +213,17 @@ class AndroidInternalStoragePathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-). ///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions. ///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default. ///If the file does not have a recognised extension, `text/plain` will be used by default.
class AndroidInternalStoragePathHandler extends AndroidPathHandler implements PlatformInternalStoragePathHandler { class AndroidInternalStoragePathHandler extends AndroidPathHandler
implements PlatformInternalStoragePathHandler {
/// Constructs a [AndroidInternalStoragePathHandler]. /// Constructs a [AndroidInternalStoragePathHandler].
AndroidInternalStoragePathHandler(PlatformInternalStoragePathHandlerCreationParams params) AndroidInternalStoragePathHandler(
PlatformInternalStoragePathHandlerCreationParams params)
: super( : super(
params is AndroidInternalStoragePathHandlerCreationParams params is AndroidInternalStoragePathHandlerCreationParams
? params ? params
: AndroidInternalStoragePathHandlerCreationParams : AndroidInternalStoragePathHandlerCreationParams
.fromPlatformInternalStoragePathHandlerCreationParams(params), .fromPlatformInternalStoragePathHandlerCreationParams(params),
); );
AndroidInternalStoragePathHandlerCreationParams get _internalParams => AndroidInternalStoragePathHandlerCreationParams get _internalParams =>
params as AndroidInternalStoragePathHandlerCreationParams; params as AndroidInternalStoragePathHandlerCreationParams;
@ -230,9 +233,6 @@ class AndroidInternalStoragePathHandler extends AndroidPathHandler implements Pl
@override @override
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {...toMap(), 'directory': directory};
...toMap(),
'directory': directory
};
} }
} }

View File

@ -24,7 +24,8 @@ class PlatformChromeSafariBrowserCreationParams {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android ///- Android
///- iOS ///- iOS
abstract class PlatformChromeSafariBrowser extends PlatformInterface implements Disposable { abstract class PlatformChromeSafariBrowser extends PlatformInterface
implements Disposable {
///Debug settings. ///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -35,21 +36,22 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///View ID used internally. ///View ID used internally.
///@{endtemplate} ///@{endtemplate}
String get id { String get id {
throw UnimplementedError( throw UnimplementedError('id is not implemented on the current platform');
'id is not implemented on the current platform');
} }
/// Creates a new [PlatformChromeSafariBrowser] /// Creates a new [PlatformChromeSafariBrowser]
factory PlatformChromeSafariBrowser(PlatformChromeSafariBrowserCreationParams params) { factory PlatformChromeSafariBrowser(
PlatformChromeSafariBrowserCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformChromeSafariBrowser chromeSafariBrowser = final PlatformChromeSafariBrowser chromeSafariBrowser = InAppWebViewPlatform
InAppWebViewPlatform.instance!.createPlatformChromeSafariBrowser(params); .instance!
.createPlatformChromeSafariBrowser(params);
PlatformInterface.verify(chromeSafariBrowser, _token); PlatformInterface.verify(chromeSafariBrowser, _token);
return chromeSafariBrowser; return chromeSafariBrowser;
} }
@ -57,14 +59,15 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// Creates a new [PlatformChromeSafariBrowser] to access static methods. /// Creates a new [PlatformChromeSafariBrowser] to access static methods.
factory PlatformChromeSafariBrowser.static() { factory PlatformChromeSafariBrowser.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformChromeSafariBrowser chromeSafariBrowserStatic = final PlatformChromeSafariBrowser chromeSafariBrowserStatic =
InAppWebViewPlatform.instance!.createPlatformChromeSafariBrowserStatic(); InAppWebViewPlatform.instance!
.createPlatformChromeSafariBrowserStatic();
PlatformInterface.verify(chromeSafariBrowserStatic, _token); PlatformInterface.verify(chromeSafariBrowserStatic, _token);
return chromeSafariBrowserStatic; return chromeSafariBrowserStatic;
} }
@ -74,7 +77,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformChromeSafariBrowser.implementation(this.params) : super(token: _token); PlatformChromeSafariBrowser.implementation(this.params)
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();
@ -100,16 +104,16 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android ///- Android
///- iOS ///- iOS
Future<void> open({WebUri? url, Future<void> open(
Map<String, String>? headers, {WebUri? url,
List<WebUri>? otherLikelyURLs, Map<String, String>? headers,
WebUri? referrer, List<WebUri>? otherLikelyURLs,
@Deprecated('Use settings instead') WebUri? referrer,
// ignore: deprecated_member_use_from_same_package @Deprecated('Use settings instead')
ChromeSafariBrowserClassOptions? options, // ignore: deprecated_member_use_from_same_package
ChromeSafariBrowserSettings? settings}) { ChromeSafariBrowserClassOptions? options,
throw UnimplementedError( ChromeSafariBrowserSettings? settings}) {
'open is not implemented on the current platform'); throw UnimplementedError('open is not implemented on the current platform');
} }
///Tells the browser to launch with [url]. ///Tells the browser to launch with [url].
@ -148,8 +152,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.mayLaunchUrl](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#mayLaunchUrl(android.net.Uri,android.os.Bundle,java.util.List%3Candroid.os.Bundle%3E))) ///- Android ([Official API - CustomTabsSession.mayLaunchUrl](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#mayLaunchUrl(android.net.Uri,android.os.Bundle,java.util.List%3Candroid.os.Bundle%3E)))
Future<bool> mayLaunchUrl( Future<bool> mayLaunchUrl({WebUri? url, List<WebUri>? otherLikelyURLs}) {
{WebUri? url, List<WebUri>? otherLikelyURLs}) {
throw UnimplementedError( throw UnimplementedError(
'mayLaunchUrl is not implemented on the current platform'); 'mayLaunchUrl is not implemented on the current platform');
} }
@ -170,8 +173,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.validateRelationship](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle))) ///- Android ([Official API - CustomTabsSession.validateRelationship](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)))
Future<bool> validateRelationship({required CustomTabsRelationType relation, Future<bool> validateRelationship(
required WebUri origin}) { {required CustomTabsRelationType relation, required WebUri origin}) {
throw UnimplementedError( throw UnimplementedError(
'validateRelationship is not implemented on the current platform'); 'validateRelationship is not implemented on the current platform');
} }
@ -405,8 +408,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections)) ///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
Future<void> invalidatePrewarmingToken( Future<void> invalidatePrewarmingToken(PrewarmingToken prewarmingToken) {
PrewarmingToken prewarmingToken) {
throw UnimplementedError( throw UnimplementedError(
'invalidatePrewarmingToken is not implemented on the current platform'); 'invalidatePrewarmingToken is not implemented on the current platform');
} }

View File

@ -28,7 +28,8 @@ class PlatformFindInteractionControllerCreationParams {
///- Android native WebView ///- Android native WebView
///- iOS ///- iOS
///- MacOS ///- MacOS
abstract class PlatformFindInteractionController extends PlatformInterface implements Disposable { abstract class PlatformFindInteractionController extends PlatformInterface
implements Disposable {
///Debug settings. ///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -36,14 +37,15 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
factory PlatformFindInteractionController( factory PlatformFindInteractionController(
PlatformFindInteractionControllerCreationParams params) { PlatformFindInteractionControllerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformFindInteractionController webViewControllerDelegate = final PlatformFindInteractionController webViewControllerDelegate =
InAppWebViewPlatform.instance!.createPlatformFindInteractionController(params); InAppWebViewPlatform.instance!
.createPlatformFindInteractionController(params);
PlatformInterface.verify(webViewControllerDelegate, _token); PlatformInterface.verify(webViewControllerDelegate, _token);
return webViewControllerDelegate; return webViewControllerDelegate;
} }
@ -53,7 +55,8 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformFindInteractionController.implementation(this.params) : super(token: _token); PlatformFindInteractionController.implementation(this.params)
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();
@ -77,11 +80,9 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
void Function( void Function(PlatformFindInteractionController controller,
PlatformFindInteractionController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
int activeMatchOrdinal, get onFindResultReceived => params.onFindResultReceived;
int numberOfMatches,
bool isDoneCounting)? get onFindResultReceived => params.onFindResultReceived;
///Finds all instances of find on the page and highlights them. Notifies [PlatformFindInteractionController.onFindResultReceived] listener. ///Finds all instances of find on the page and highlights them. Notifies [PlatformFindInteractionController.onFindResultReceived] listener.
/// ///

View File

@ -61,7 +61,8 @@ class PlatformInAppBrowserCreationParams {
///- Android native WebView ///- Android native WebView
///- iOS ///- iOS
///- MacOS ///- MacOS
abstract class PlatformInAppBrowser extends PlatformInterface implements Disposable { abstract class PlatformInAppBrowser extends PlatformInterface
implements Disposable {
///Debug settings. ///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -81,17 +82,20 @@ abstract class PlatformInAppBrowser extends PlatformInterface implements Disposa
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.pullToRefreshController} ///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.pullToRefreshController}
///Represents the pull-to-refresh feature controller. ///Represents the pull-to-refresh feature controller.
///@{endtemplate} ///@{endtemplate}
PlatformPullToRefreshController? get pullToRefreshController => params.pullToRefreshController; PlatformPullToRefreshController? get pullToRefreshController =>
params.pullToRefreshController;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.findInteractionController} ///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.findInteractionController}
///Represents the find interaction feature controller. ///Represents the find interaction feature controller.
///@{endtemplate} ///@{endtemplate}
PlatformFindInteractionController? get findInteractionController => params.findInteractionController; PlatformFindInteractionController? get findInteractionController =>
params.findInteractionController;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.initialUserScripts} ///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.initialUserScripts}
///Initial list of user scripts to be loaded at start or end of a page loading. ///Initial list of user scripts to be loaded at start or end of a page loading.
///@{endtemplate} ///@{endtemplate}
UnmodifiableListView<UserScript>? get initialUserScripts => params.initialUserScripts; UnmodifiableListView<UserScript>? get initialUserScripts =>
params.initialUserScripts;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.windowId} ///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.windowId}
///The window id of a [CreateWindowAction.windowId]. ///The window id of a [CreateWindowAction.windowId].
@ -980,7 +984,7 @@ abstract class PlatformInAppBrowserEvents {
///Use [onGeolocationPermissionsShowPrompt] instead. ///Use [onGeolocationPermissionsShowPrompt] instead.
@Deprecated("Use onGeolocationPermissionsShowPrompt instead") @Deprecated("Use onGeolocationPermissionsShowPrompt instead")
Future<GeolocationPermissionShowPromptResponse?>? Future<GeolocationPermissionShowPromptResponse?>?
androidOnGeolocationPermissionsShowPrompt(String origin) { androidOnGeolocationPermissionsShowPrompt(String origin) {
return null; return null;
} }
@ -993,7 +997,7 @@ abstract class PlatformInAppBrowserEvents {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback))) ///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)))
Future<GeolocationPermissionShowPromptResponse?>? Future<GeolocationPermissionShowPromptResponse?>?
onGeolocationPermissionsShowPrompt(String origin) { onGeolocationPermissionsShowPrompt(String origin) {
return null; return null;
} }
@ -1281,9 +1285,9 @@ abstract class PlatformInAppBrowserEvents {
///- iOS ///- iOS
///- MacOS ///- MacOS
void onCameraCaptureStateChanged( void onCameraCaptureStateChanged(
MediaCaptureState? oldState, MediaCaptureState? oldState,
MediaCaptureState? newState, MediaCaptureState? newState,
) {} ) {}
///Event fired when a change in the microphone capture state occurred. ///Event fired when a change in the microphone capture state occurred.
///Event fired when a change in the microphone capture state occurred. ///Event fired when a change in the microphone capture state occurred.
@ -1296,9 +1300,9 @@ abstract class PlatformInAppBrowserEvents {
///- iOS ///- iOS
///- MacOS ///- MacOS
void onMicrophoneCaptureStateChanged( void onMicrophoneCaptureStateChanged(
MediaCaptureState? oldState, MediaCaptureState? oldState,
MediaCaptureState? newState, MediaCaptureState? newState,
) {} ) {}
///Event fired when the content size of the `WebView` changes. ///Event fired when the content size of the `WebView` changes.
/// ///

View File

@ -47,7 +47,8 @@ class PlatformInAppWebViewControllerCreationParams {
/// ///
///If you are using the [InAppWebView] widget, an [PlatformInAppWebViewController] instance can be obtained by setting the [InAppWebView.onWebViewCreated] ///If you are using the [InAppWebView] widget, an [PlatformInAppWebViewController] instance can be obtained by setting the [InAppWebView.onWebViewCreated]
///callback. Instead, if you are using an [PlatformInAppBrowser] instance, you can get it through the [PlatformInAppBrowser.webViewController] attribute. ///callback. Instead, if you are using an [PlatformInAppBrowser] instance, you can get it through the [PlatformInAppBrowser.webViewController] attribute.
abstract class PlatformInAppWebViewController extends PlatformInterface implements Disposable { abstract class PlatformInAppWebViewController extends PlatformInterface
implements Disposable {
///Debug settings used by [PlatformInAppWebViewWidget], [PlatformHeadlessInAppWebView] and [PlatformInAppBrowser]. ///Debug settings used by [PlatformInAppWebViewWidget], [PlatformHeadlessInAppWebView] and [PlatformInAppBrowser].
///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events. ///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings( static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(
@ -78,14 +79,15 @@ abstract class PlatformInAppWebViewController extends PlatformInterface implemen
/// Creates a new [PlatformInAppWebViewController] to access static methods. /// Creates a new [PlatformInAppWebViewController] to access static methods.
factory PlatformInAppWebViewController.static() { factory PlatformInAppWebViewController.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformInAppWebViewController inAppWebViewControllerStatic = final PlatformInAppWebViewController inAppWebViewControllerStatic =
InAppWebViewPlatform.instance!.createPlatformInAppWebViewControllerStatic(); InAppWebViewPlatform.instance!
.createPlatformInAppWebViewControllerStatic();
PlatformInterface.verify(inAppWebViewControllerStatic, _token); PlatformInterface.verify(inAppWebViewControllerStatic, _token);
return inAppWebViewControllerStatic; return inAppWebViewControllerStatic;
} }

View File

@ -17,7 +17,8 @@ import '../print_job/main.dart';
///Class that represents a WebView. Used by [InAppWebView], [HeadlessInAppWebView] and the WebView of [PlatformInAppBrowser]. ///Class that represents a WebView. Used by [InAppWebView], [HeadlessInAppWebView] and the WebView of [PlatformInAppBrowser].
///{@endtemplate} ///{@endtemplate}
class PlatformWebViewCreationParams<T> { class PlatformWebViewCreationParams<T> {
final T Function(PlatformInAppWebViewController controller)? controllerFromPlatform; final T Function(PlatformInAppWebViewController controller)?
controllerFromPlatform;
///{@template flutter_inappwebview.WebView.windowId} ///{@template flutter_inappwebview.WebView.windowId}
///The window id of a [CreateWindowAction.windowId]. ///The window id of a [CreateWindowAction.windowId].
@ -54,8 +55,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, WebUri? url)? final void Function(T controller, WebUri? url)? onLoadStart;
onLoadStart;
///{@template flutter_inappwebview.WebView.onLoadStop} ///{@template flutter_inappwebview.WebView.onLoadStop}
///Event fired when the `WebView` finishes loading an [url]. ///Event fired when the `WebView` finishes loading an [url].
@ -69,13 +69,12 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
///- Web ([Official API - Window.onload](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event)) ///- Web ([Official API - Window.onload](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, WebUri? url)? final void Function(T controller, WebUri? url)? onLoadStop;
onLoadStop;
///Use [onReceivedError] instead. ///Use [onReceivedError] instead.
@Deprecated("Use onReceivedError instead") @Deprecated("Use onReceivedError instead")
final void Function(T controller, Uri? url, int code, final void Function(T controller, Uri? url, int code, String message)?
String message)? onLoadError; onLoadError;
///{@template flutter_inappwebview.WebView.onReceivedError} ///{@template flutter_inappwebview.WebView.onReceivedError}
///Event fired when the `WebView` encounters an [error] loading a [request]. ///Event fired when the `WebView` encounters an [error] loading a [request].
@ -85,13 +84,15 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview)) ///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, final void Function(
WebResourceRequest request, WebResourceError error)? onReceivedError; T controller, WebResourceRequest request, WebResourceError error)?
onReceivedError;
///Use [onReceivedHttpError] instead. ///Use [onReceivedHttpError] instead.
@Deprecated("Use onReceivedHttpError instead") @Deprecated("Use onReceivedHttpError instead")
final void Function(T controller, Uri? url, final void Function(
int statusCode, String description)? onLoadHttpError; T controller, Uri? url, int statusCode, String description)?
onLoadHttpError;
///{@template flutter_inappwebview.WebView.onReceivedHttpError} ///{@template flutter_inappwebview.WebView.onReceivedHttpError}
///Event fired when the `WebView` receives an HTTP error. ///Event fired when the `WebView` receives an HTTP error.
@ -107,9 +108,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview)) ///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, WebResourceRequest request,
T controller,
WebResourceRequest request,
WebResourceResponse errorResponse)? onReceivedHttpError; WebResourceResponse errorResponse)? onReceivedHttpError;
///{@template flutter_inappwebview.WebView.onProgressChanged} ///{@template flutter_inappwebview.WebView.onProgressChanged}
@ -120,8 +119,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, int progress)? final void Function(T controller, int progress)? onProgressChanged;
onProgressChanged;
///{@template flutter_inappwebview.WebView.onConsoleMessage} ///{@template flutter_inappwebview.WebView.onConsoleMessage}
///Event fired when the `WebView` receives a [ConsoleMessage]. ///Event fired when the `WebView` receives a [ConsoleMessage].
@ -134,8 +132,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ///- MacOS
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, ConsoleMessage consoleMessage)?
T controller, ConsoleMessage consoleMessage)?
onConsoleMessage; onConsoleMessage;
///{@template flutter_inappwebview.WebView.shouldOverrideUrlLoading} ///{@template flutter_inappwebview.WebView.shouldOverrideUrlLoading}
@ -171,9 +168,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, LoadedResource resource)? onLoadResource;
T controller, LoadedResource resource)?
onLoadResource;
///{@template flutter_inappwebview.WebView.onScrollChanged} ///{@template flutter_inappwebview.WebView.onScrollChanged}
///Event fired when the `WebView` scrolls. ///Event fired when the `WebView` scrolls.
@ -192,13 +187,11 @@ class PlatformWebViewCreationParams<T> {
///- Web ([Official API - Window.onscroll](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll)) ///- Web ([Official API - Window.onscroll](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll))
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, int x, int y)? final void Function(T controller, int x, int y)? onScrollChanged;
onScrollChanged;
///Use [onDownloadStartRequest] instead ///Use [onDownloadStartRequest] instead
@Deprecated('Use onDownloadStartRequest instead') @Deprecated('Use onDownloadStartRequest instead')
final void Function(T controller, Uri url)? final void Function(T controller, Uri url)? onDownloadStart;
onDownloadStart;
///{@template flutter_inappwebview.WebView.onDownloadStartRequest} ///{@template flutter_inappwebview.WebView.onDownloadStartRequest}
///Event fired when `WebView` recognizes a downloadable file. ///Event fired when `WebView` recognizes a downloadable file.
@ -213,13 +206,13 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, final void Function(T controller, DownloadStartRequest downloadStartRequest)?
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest; onDownloadStartRequest;
///Use [onLoadResourceWithCustomScheme] instead. ///Use [onLoadResourceWithCustomScheme] instead.
@Deprecated('Use onLoadResourceWithCustomScheme instead') @Deprecated('Use onLoadResourceWithCustomScheme instead')
final Future<CustomSchemeResponse?> Function( final Future<CustomSchemeResponse?> Function(T controller, Uri url)?
T controller, Uri url)? onLoadResourceCustomScheme; onLoadResourceCustomScheme;
///{@template flutter_inappwebview.WebView.onLoadResourceWithCustomScheme} ///{@template flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
///Event fired when the `WebView` finds the `custom-scheme` while loading a resource. ///Event fired when the `WebView` finds the `custom-scheme` while loading a resource.
@ -231,8 +224,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler)) ///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
///{@endtemplate} ///{@endtemplate}
final Future<CustomSchemeResponse?> Function( final Future<CustomSchemeResponse?> Function(
T controller, WebResourceRequest request)? T controller, WebResourceRequest request)? onLoadResourceWithCustomScheme;
onLoadResourceWithCustomScheme;
///{@template flutter_inappwebview.WebView.onCreateWindow} ///{@template flutter_inappwebview.WebView.onCreateWindow}
///Event fired when the `WebView` requests the host application to create a new window, ///Event fired when the `WebView` requests the host application to create a new window,
@ -273,8 +265,8 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview)) ///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final Future<bool?> Function(T controller, final Future<bool?> Function(
CreateWindowAction createWindowAction)? onCreateWindow; T controller, CreateWindowAction createWindowAction)? onCreateWindow;
///{@template flutter_inappwebview.WebView.onCloseWindow} ///{@template flutter_inappwebview.WebView.onCloseWindow}
///Event fired when the host application should close the given WebView and remove it from the view system if necessary. ///Event fired when the host application should close the given WebView and remove it from the view system if necessary.
@ -327,8 +319,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview)) ///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
///{@endtemplate} ///{@endtemplate}
final Future<JsAlertResponse?> Function( final Future<JsAlertResponse?> Function(
T controller, JsAlertRequest jsAlertRequest)? T controller, JsAlertRequest jsAlertRequest)? onJsAlert;
onJsAlert;
///{@template flutter_inappwebview.WebView.onJsConfirm} ///{@template flutter_inappwebview.WebView.onJsConfirm}
///Event fired when javascript calls the `confirm()` method to display a confirm dialog. ///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
@ -342,8 +333,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview)) ///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
///{@endtemplate} ///{@endtemplate}
final Future<JsConfirmResponse?> Function( final Future<JsConfirmResponse?> Function(
T controller, JsConfirmRequest jsConfirmRequest)? T controller, JsConfirmRequest jsConfirmRequest)? onJsConfirm;
onJsConfirm;
///{@template flutter_inappwebview.WebView.onJsPrompt} ///{@template flutter_inappwebview.WebView.onJsPrompt}
///Event fired when javascript calls the `prompt()` method to display a prompt dialog. ///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
@ -357,8 +347,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview)) ///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
///{@endtemplate} ///{@endtemplate}
final Future<JsPromptResponse?> Function( final Future<JsPromptResponse?> Function(
T controller, JsPromptRequest jsPromptRequest)? T controller, JsPromptRequest jsPromptRequest)? onJsPrompt;
onJsPrompt;
///{@template flutter_inappwebview.WebView.onReceivedHttpAuthRequest} ///{@template flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request. ///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
@ -370,8 +359,9 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview)) ///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///{@endtemplate} ///{@endtemplate}
final Future<HttpAuthResponse?> Function(T controller, final Future<HttpAuthResponse?> Function(
HttpAuthenticationChallenge challenge)? onReceivedHttpAuthRequest; T controller, HttpAuthenticationChallenge challenge)?
onReceivedHttpAuthRequest;
///{@template flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest} ///{@template flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
///Event fired when the WebView need to perform server trust authentication (certificate validation). ///Event fired when the WebView need to perform server trust authentication (certificate validation).
@ -402,13 +392,12 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///{@endtemplate} ///{@endtemplate}
final Future<ClientCertResponse?> Function( final Future<ClientCertResponse?> Function(
T controller, ClientCertChallenge challenge)? T controller, ClientCertChallenge challenge)? onReceivedClientCertRequest;
onReceivedClientCertRequest;
///Use [FindInteractionController.onFindResultReceived] instead. ///Use [FindInteractionController.onFindResultReceived] instead.
@Deprecated('Use FindInteractionController.onFindResultReceived instead') @Deprecated('Use FindInteractionController.onFindResultReceived instead')
final void Function(T controller, int activeMatchOrdinal, final void Function(T controller, int activeMatchOrdinal, int numberOfMatches,
int numberOfMatches, bool isDoneCounting)? onFindResultReceived; bool isDoneCounting)? onFindResultReceived;
///{@template flutter_inappwebview.WebView.shouldInterceptAjaxRequest} ///{@template flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
///Event fired when an `XMLHttpRequest` is sent to a server. ///Event fired when an `XMLHttpRequest` is sent to a server.
@ -427,8 +416,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final Future<AjaxRequest?> Function( final Future<AjaxRequest?> Function(T controller, AjaxRequest ajaxRequest)?
T controller, AjaxRequest ajaxRequest)?
shouldInterceptAjaxRequest; shouldInterceptAjaxRequest;
///{@template flutter_inappwebview.WebView.onAjaxReadyStateChange} ///{@template flutter_inappwebview.WebView.onAjaxReadyStateChange}
@ -449,8 +437,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final Future<AjaxRequestAction?> Function( final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)? T controller, AjaxRequest ajaxRequest)? onAjaxReadyStateChange;
onAjaxReadyStateChange;
///{@template flutter_inappwebview.WebView.onAjaxProgress} ///{@template flutter_inappwebview.WebView.onAjaxProgress}
///Event fired as an `XMLHttpRequest` progress. ///Event fired as an `XMLHttpRequest` progress.
@ -470,8 +457,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final Future<AjaxRequestAction?> Function( final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)? T controller, AjaxRequest ajaxRequest)? onAjaxProgress;
onAjaxProgress;
///{@template flutter_inappwebview.WebView.shouldInterceptFetchRequest} ///{@template flutter_inappwebview.WebView.shouldInterceptFetchRequest}
///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API). ///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
@ -490,8 +476,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final Future<FetchRequest?> Function( final Future<FetchRequest?> Function(T controller, FetchRequest fetchRequest)?
T controller, FetchRequest fetchRequest)?
shouldInterceptFetchRequest; shouldInterceptFetchRequest;
///{@template flutter_inappwebview.WebView.onUpdateVisitedHistory} ///{@template flutter_inappwebview.WebView.onUpdateVisitedHistory}
@ -512,8 +497,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ///- MacOS
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, WebUri? url, bool? isReload)?
T controller, WebUri? url, bool? isReload)?
onUpdateVisitedHistory; onUpdateVisitedHistory;
///Use [onPrintRequest] instead ///Use [onPrintRequest] instead
@ -550,8 +534,8 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - View.setOnLongClickListener](https://developer.android.com/reference/android/view/View#setOnLongClickListener(android.view.View.OnLongClickListener))) ///- Android native WebView ([Official API - View.setOnLongClickListener](https://developer.android.com/reference/android/view/View#setOnLongClickListener(android.view.View.OnLongClickListener)))
///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer)) ///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, final void Function(T controller, InAppWebViewHitTestResult hitTestResult)?
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult; onLongPressHitTestResult;
///{@template flutter_inappwebview.WebView.onEnterFullscreen} ///{@template flutter_inappwebview.WebView.onEnterFullscreen}
///Event fired when the current page has entered full screen mode. ///Event fired when the current page has entered full screen mode.
@ -592,8 +576,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview)) ///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, WebUri? url)? final void Function(T controller, WebUri? url)? onPageCommitVisible;
onPageCommitVisible;
///{@template flutter_inappwebview.WebView.onTitleChanged} ///{@template flutter_inappwebview.WebView.onTitleChanged}
///Event fired when a change in the document title occurred. ///Event fired when a change in the document title occurred.
@ -608,8 +591,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ///- MacOS
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, String? title)? final void Function(T controller, String? title)? onTitleChanged;
onTitleChanged;
///{@template flutter_inappwebview.WebView.onOverScrolled} ///{@template flutter_inappwebview.WebView.onOverScrolled}
///Event fired to respond to the results of an over-scroll operation. ///Event fired to respond to the results of an over-scroll operation.
@ -626,8 +608,8 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean))) ///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean)))
///- iOS ///- iOS
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, int x, int y, final void Function(T controller, int x, int y, bool clampedX, bool clampedY)?
bool clampedX, bool clampedY)? onOverScrolled; onOverScrolled;
///{@template flutter_inappwebview.WebView.onZoomScaleChanged} ///{@template flutter_inappwebview.WebView.onZoomScaleChanged}
///Event fired when the zoom scale of the WebView has changed. ///Event fired when the zoom scale of the WebView has changed.
@ -643,16 +625,14 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidZoom](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom)) ///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidZoom](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom))
///- Web ///- Web
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, double oldScale, double newScale)?
T controller, double oldScale, double newScale)?
onZoomScaleChanged; onZoomScaleChanged;
///Use [onSafeBrowsingHit] instead. ///Use [onSafeBrowsingHit] instead.
@Deprecated("Use onSafeBrowsingHit instead") @Deprecated("Use onSafeBrowsingHit instead")
final Future<SafeBrowsingResponse?> Function( final Future<SafeBrowsingResponse?> Function(
T controller, T controller, Uri url, SafeBrowsingThreat? threatType)?
Uri url, androidOnSafeBrowsingHit;
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
///{@template flutter_inappwebview.WebView.onSafeBrowsingHit} ///{@template flutter_inappwebview.WebView.onSafeBrowsingHit}
///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing. ///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
@ -668,16 +648,14 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - WebViewClient.onSafeBrowsingHit](https://developer.android.com/reference/android/webkit/WebViewClient#onSafeBrowsingHit(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20int,%20android.webkit.SafeBrowsingResponse))) ///- Android native WebView ([Official API - WebViewClient.onSafeBrowsingHit](https://developer.android.com/reference/android/webkit/WebViewClient#onSafeBrowsingHit(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20int,%20android.webkit.SafeBrowsingResponse)))
///{@endtemplate} ///{@endtemplate}
final Future<SafeBrowsingResponse?> Function( final Future<SafeBrowsingResponse?> Function(
T controller, T controller, WebUri url, SafeBrowsingThreat? threatType)?
WebUri url, onSafeBrowsingHit;
SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
///Use [onPermissionRequest] instead. ///Use [onPermissionRequest] instead.
@Deprecated("Use onPermissionRequest instead") @Deprecated("Use onPermissionRequest instead")
final Future<PermissionRequestResponse?> Function( final Future<PermissionRequestResponse?> Function(
T controller, T controller, String origin, List<String> resources)?
String origin, androidOnPermissionRequest;
List<String> resources)? androidOnPermissionRequest;
///{@template flutter_inappwebview.WebView.onPermissionRequest} ///{@template flutter_inappwebview.WebView.onPermissionRequest}
///Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied. ///Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied.
@ -696,14 +674,13 @@ class PlatformWebViewCreationParams<T> {
///- iOS ///- iOS
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
final Future<PermissionResponse?> Function(T controller, final Future<PermissionResponse?> Function(
PermissionRequest permissionRequest)? onPermissionRequest; T controller, PermissionRequest permissionRequest)? onPermissionRequest;
///Use [onGeolocationPermissionsShowPrompt] instead. ///Use [onGeolocationPermissionsShowPrompt] instead.
@Deprecated("Use onGeolocationPermissionsShowPrompt instead") @Deprecated("Use onGeolocationPermissionsShowPrompt instead")
final Future<GeolocationPermissionShowPromptResponse?> Function( final Future<GeolocationPermissionShowPromptResponse?> Function(
T controller, String origin)? T controller, String origin)? androidOnGeolocationPermissionsShowPrompt;
androidOnGeolocationPermissionsShowPrompt;
///{@template flutter_inappwebview.WebView.onGeolocationPermissionsShowPrompt} ///{@template flutter_inappwebview.WebView.onGeolocationPermissionsShowPrompt}
///Event that notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin. ///Event that notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin.
@ -716,13 +693,11 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback))) ///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)))
///{@endtemplate} ///{@endtemplate}
final Future<GeolocationPermissionShowPromptResponse?> Function( final Future<GeolocationPermissionShowPromptResponse?> Function(
T controller, String origin)? T controller, String origin)? onGeolocationPermissionsShowPrompt;
onGeolocationPermissionsShowPrompt;
///Use [onGeolocationPermissionsHidePrompt] instead. ///Use [onGeolocationPermissionsHidePrompt] instead.
@Deprecated("Use onGeolocationPermissionsHidePrompt instead") @Deprecated("Use onGeolocationPermissionsHidePrompt instead")
final void Function(T controller)? final void Function(T controller)? androidOnGeolocationPermissionsHidePrompt;
androidOnGeolocationPermissionsHidePrompt;
///{@template flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt} ///{@template flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt}
///Notify the host application that a request for Geolocation permissions, made with a previous call to [onGeolocationPermissionsShowPrompt] has been canceled. ///Notify the host application that a request for Geolocation permissions, made with a previous call to [onGeolocationPermissionsShowPrompt] has been canceled.
@ -731,14 +706,12 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt())) ///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller)? final void Function(T controller)? onGeolocationPermissionsHidePrompt;
onGeolocationPermissionsHidePrompt;
///Use [shouldInterceptRequest] instead. ///Use [shouldInterceptRequest] instead.
@Deprecated("Use shouldInterceptRequest instead") @Deprecated("Use shouldInterceptRequest instead")
final Future<WebResourceResponse?> Function( final Future<WebResourceResponse?> Function(
T controller, WebResourceRequest request)? T controller, WebResourceRequest request)? androidShouldInterceptRequest;
androidShouldInterceptRequest;
///{@template flutter_inappwebview.WebView.shouldInterceptRequest} ///{@template flutter_inappwebview.WebView.shouldInterceptRequest}
///Notify the host application of a resource request and allow the application to return the data. ///Notify the host application of a resource request and allow the application to return the data.
@ -759,13 +732,11 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - WebViewClient.shouldInterceptRequest](https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest))) ///- Android native WebView ([Official API - WebViewClient.shouldInterceptRequest](https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest)))
///{@endtemplate} ///{@endtemplate}
final Future<WebResourceResponse?> Function( final Future<WebResourceResponse?> Function(
T controller, WebResourceRequest request)? T controller, WebResourceRequest request)? shouldInterceptRequest;
shouldInterceptRequest;
///Use [onRenderProcessUnresponsive] instead. ///Use [onRenderProcessUnresponsive] instead.
@Deprecated("Use onRenderProcessUnresponsive instead") @Deprecated("Use onRenderProcessUnresponsive instead")
final Future<WebViewRenderProcessAction?> Function( final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
T controller, Uri? url)?
androidOnRenderProcessUnresponsive; androidOnRenderProcessUnresponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessUnresponsive} ///{@template flutter_inappwebview.WebView.onRenderProcessUnresponsive}
@ -789,14 +760,12 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessUnresponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess))) ///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessUnresponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
///{@endtemplate} ///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function( final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
T controller, WebUri? url)?
onRenderProcessUnresponsive; onRenderProcessUnresponsive;
///Use [onRenderProcessResponsive] instead. ///Use [onRenderProcessResponsive] instead.
@Deprecated("Use onRenderProcessResponsive instead") @Deprecated("Use onRenderProcessResponsive instead")
final Future<WebViewRenderProcessAction?> Function( final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
T controller, Uri? url)?
androidOnRenderProcessResponsive; androidOnRenderProcessResponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessResponsive} ///{@template flutter_inappwebview.WebView.onRenderProcessResponsive}
@ -813,14 +782,12 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessResponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess))) ///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessResponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
///{@endtemplate} ///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function( final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
T controller, WebUri? url)?
onRenderProcessResponsive; onRenderProcessResponsive;
///Use [onRenderProcessGone] instead. ///Use [onRenderProcessGone] instead.
@Deprecated("Use onRenderProcessGone instead") @Deprecated("Use onRenderProcessGone instead")
final void Function( final void Function(T controller, RenderProcessGoneDetail detail)?
T controller, RenderProcessGoneDetail detail)?
androidOnRenderProcessGone; androidOnRenderProcessGone;
///{@template flutter_inappwebview.WebView.onRenderProcessGone} ///{@template flutter_inappwebview.WebView.onRenderProcessGone}
@ -835,14 +802,13 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onRenderProcessGone](https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail))) ///- Android native WebView ([Official API - WebViewClient.onRenderProcessGone](https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)))
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, RenderProcessGoneDetail detail)?
T controller, RenderProcessGoneDetail detail)?
onRenderProcessGone; onRenderProcessGone;
///Use [onFormResubmission] instead. ///Use [onFormResubmission] instead.
@Deprecated('Use onFormResubmission instead') @Deprecated('Use onFormResubmission instead')
final Future<FormResubmissionAction?> Function( final Future<FormResubmissionAction?> Function(T controller, Uri? url)?
T controller, Uri? url)? androidOnFormResubmission; androidOnFormResubmission;
///{@template flutter_inappwebview.WebView.onFormResubmission} ///{@template flutter_inappwebview.WebView.onFormResubmission}
///As the host application if the browser should resend data as the requested page was a result of a POST. The default is to not resend the data. ///As the host application if the browser should resend data as the requested page was a result of a POST. The default is to not resend the data.
@ -850,19 +816,17 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onFormResubmission](https://developer.android.com/reference/android/webkit/WebViewClient#onFormResubmission(android.webkit.WebView,%20android.os.Message,%20android.os.Message))) ///- Android native WebView ([Official API - WebViewClient.onFormResubmission](https://developer.android.com/reference/android/webkit/WebViewClient#onFormResubmission(android.webkit.WebView,%20android.os.Message,%20android.os.Message)))
///{@endtemplate} ///{@endtemplate}
final Future<FormResubmissionAction?> Function( final Future<FormResubmissionAction?> Function(T controller, WebUri? url)?
T controller, WebUri? url)? onFormResubmission; onFormResubmission;
///Use [onZoomScaleChanged] instead. ///Use [onZoomScaleChanged] instead.
@Deprecated('Use onZoomScaleChanged instead') @Deprecated('Use onZoomScaleChanged instead')
final void Function( final void Function(T controller, double oldScale, double newScale)?
T controller, double oldScale, double newScale)?
androidOnScaleChanged; androidOnScaleChanged;
///Use [onReceivedIcon] instead. ///Use [onReceivedIcon] instead.
@Deprecated('Use onReceivedIcon instead') @Deprecated('Use onReceivedIcon instead')
final void Function(T controller, Uint8List icon)? final void Function(T controller, Uint8List icon)? androidOnReceivedIcon;
androidOnReceivedIcon;
///{@template flutter_inappwebview.WebView.onReceivedIcon} ///{@template flutter_inappwebview.WebView.onReceivedIcon}
///Event fired when there is new favicon for the current page. ///Event fired when there is new favicon for the current page.
@ -872,13 +836,11 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedIcon](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap))) ///- Android native WebView ([Official API - WebChromeClient.onReceivedIcon](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap)))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, Uint8List icon)? final void Function(T controller, Uint8List icon)? onReceivedIcon;
onReceivedIcon;
///Use [onReceivedTouchIconUrl] instead. ///Use [onReceivedTouchIconUrl] instead.
@Deprecated('Use onReceivedTouchIconUrl instead') @Deprecated('Use onReceivedTouchIconUrl instead')
final void Function( final void Function(T controller, Uri url, bool precomposed)?
T controller, Uri url, bool precomposed)?
androidOnReceivedTouchIconUrl; androidOnReceivedTouchIconUrl;
///{@template flutter_inappwebview.WebView.onReceivedTouchIconUrl} ///{@template flutter_inappwebview.WebView.onReceivedTouchIconUrl}
@ -891,15 +853,14 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedTouchIconUrl](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean))) ///- Android native WebView ([Official API - WebChromeClient.onReceivedTouchIconUrl](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean)))
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, WebUri url, bool precomposed)?
T controller, WebUri url, bool precomposed)?
onReceivedTouchIconUrl; onReceivedTouchIconUrl;
///Use [onJsBeforeUnload] instead. ///Use [onJsBeforeUnload] instead.
@Deprecated('Use onJsBeforeUnload instead') @Deprecated('Use onJsBeforeUnload instead')
final Future<JsBeforeUnloadResponse?> Function( final Future<JsBeforeUnloadResponse?> Function(
T controller, T controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload; androidOnJsBeforeUnload;
///{@template flutter_inappwebview.WebView.onJsBeforeUnload} ///{@template flutter_inappwebview.WebView.onJsBeforeUnload}
///Event fired when the client should display a dialog to confirm navigation away from the current page. ///Event fired when the client should display a dialog to confirm navigation away from the current page.
@ -916,13 +877,12 @@ class PlatformWebViewCreationParams<T> {
///- Android native WebView ([Official API - WebChromeClient.onJsBeforeUnload](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsBeforeUnload(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult))) ///- Android native WebView ([Official API - WebChromeClient.onJsBeforeUnload](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsBeforeUnload(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///{@endtemplate} ///{@endtemplate}
final Future<JsBeforeUnloadResponse?> Function( final Future<JsBeforeUnloadResponse?> Function(
T controller, T controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload; onJsBeforeUnload;
///Use [onReceivedLoginRequest] instead. ///Use [onReceivedLoginRequest] instead.
@Deprecated('Use onReceivedLoginRequest instead') @Deprecated('Use onReceivedLoginRequest instead')
final void Function( final void Function(T controller, LoginRequest loginRequest)?
T controller, LoginRequest loginRequest)?
androidOnReceivedLoginRequest; androidOnReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onReceivedLoginRequest} ///{@template flutter_inappwebview.WebView.onReceivedLoginRequest}
@ -933,8 +893,7 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedLoginRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedLoginRequest(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String))) ///- Android native WebView ([Official API - WebViewClient.onReceivedLoginRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedLoginRequest(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String)))
///{@endtemplate} ///{@endtemplate}
final void Function( final void Function(T controller, LoginRequest loginRequest)?
T controller, LoginRequest loginRequest)?
onReceivedLoginRequest; onReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onPermissionRequestCanceled} ///{@template flutter_inappwebview.WebView.onPermissionRequestCanceled}
@ -949,8 +908,8 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest))) ///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, final void Function(T controller, PermissionRequest permissionRequest)?
PermissionRequest permissionRequest)? onPermissionRequestCanceled; onPermissionRequestCanceled;
///{@template flutter_inappwebview.WebView.onRequestFocus} ///{@template flutter_inappwebview.WebView.onRequestFocus}
///Request display and focus for this WebView. ///Request display and focus for this WebView.
@ -963,8 +922,7 @@ class PlatformWebViewCreationParams<T> {
///Use [onWebContentProcessDidTerminate] instead. ///Use [onWebContentProcessDidTerminate] instead.
@Deprecated('Use onWebContentProcessDidTerminate instead') @Deprecated('Use onWebContentProcessDidTerminate instead')
final void Function(T controller)? final void Function(T controller)? iosOnWebContentProcessDidTerminate;
iosOnWebContentProcessDidTerminate;
///{@template flutter_inappwebview.WebView.onWebContentProcessDidTerminate} ///{@template flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
///Invoked when the web view's web content process is terminated. ///Invoked when the web view's web content process is terminated.
@ -973,8 +931,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi)) ///- iOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi)) ///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///{@endtemplate} ///{@endtemplate}
final void Function(T controller)? final void Function(T controller)? onWebContentProcessDidTerminate;
onWebContentProcessDidTerminate;
///Use [onDidReceiveServerRedirectForProvisionalNavigation] instead. ///Use [onDidReceiveServerRedirectForProvisionalNavigation] instead.
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') @Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
@ -994,8 +951,8 @@ class PlatformWebViewCreationParams<T> {
///Use [onNavigationResponse] instead. ///Use [onNavigationResponse] instead.
@Deprecated('Use onNavigationResponse instead') @Deprecated('Use onNavigationResponse instead')
final Future<IOSNavigationResponseAction?> Function( final Future<IOSNavigationResponseAction?> Function(
T controller, T controller, IOSWKNavigationResponse navigationResponse)?
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse; iosOnNavigationResponse;
///{@template flutter_inappwebview.WebView.onNavigationResponse} ///{@template flutter_inappwebview.WebView.onNavigationResponse}
///Called when a web view asks for permission to navigate to new content after the response to the navigation request is known. ///Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.
@ -1009,14 +966,14 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///{@endtemplate} ///{@endtemplate}
final Future<NavigationResponseAction?> Function( final Future<NavigationResponseAction?> Function(
T controller, T controller, NavigationResponse navigationResponse)?
NavigationResponse navigationResponse)? onNavigationResponse; onNavigationResponse;
///Use [shouldAllowDeprecatedTLS] instead. ///Use [shouldAllowDeprecatedTLS] instead.
@Deprecated('Use shouldAllowDeprecatedTLS instead') @Deprecated('Use shouldAllowDeprecatedTLS instead')
final Future<IOSShouldAllowDeprecatedTLSAction?> Function( final Future<IOSShouldAllowDeprecatedTLSAction?> Function(
T controller, T controller, URLAuthenticationChallenge challenge)?
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS; iosShouldAllowDeprecatedTLS;
///{@template flutter_inappwebview.WebView.shouldAllowDeprecatedTLS} ///{@template flutter_inappwebview.WebView.shouldAllowDeprecatedTLS}
///Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1). ///Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1).
@ -1032,8 +989,8 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview)) ///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
///{@endtemplate} ///{@endtemplate}
final Future<ShouldAllowDeprecatedTLSAction?> Function( final Future<ShouldAllowDeprecatedTLSAction?> Function(
T controller, T controller, URLAuthenticationChallenge challenge)?
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS; shouldAllowDeprecatedTLS;
///{@template flutter_inappwebview.WebView.onCameraCaptureStateChanged} ///{@template flutter_inappwebview.WebView.onCameraCaptureStateChanged}
///Event fired when a change in the camera capture state occurred. ///Event fired when a change in the camera capture state occurred.
@ -1079,8 +1036,8 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- iOS ///- iOS
///{@endtemplate} ///{@endtemplate}
final void Function(T controller, Size oldContentSize, final void Function(T controller, Size oldContentSize, Size newContentSize)?
Size newContentSize)? onContentSizeChanged; onContentSizeChanged;
///{@template flutter_inappwebview.WebView.initialUrlRequest} ///{@template flutter_inappwebview.WebView.initialUrlRequest}
///Initial url request that will be loaded. ///Initial url request that will be loaded.
@ -1181,7 +1138,7 @@ class PlatformWebViewCreationParams<T> {
///{@macro flutter_inappwebview.WebView} ///{@macro flutter_inappwebview.WebView}
const PlatformWebViewCreationParams( const PlatformWebViewCreationParams(
{this.controllerFromPlatform, {this.controllerFromPlatform,
this.windowId, this.windowId,
this.onWebViewCreated, this.onWebViewCreated,
this.onLoadStart, this.onLoadStart,
this.onLoadStop, this.onLoadStop,

View File

@ -427,8 +427,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface {
/// This function should only be called by the app-facing package. /// This function should only be called by the app-facing package.
/// Look at using [ChromeSafariBrowser] in `flutter_inappwebview` instead. /// Look at using [ChromeSafariBrowser] in `flutter_inappwebview` instead.
PlatformChromeSafariBrowser createPlatformChromeSafariBrowser( PlatformChromeSafariBrowser createPlatformChromeSafariBrowser(
PlatformChromeSafariBrowserCreationParams params, PlatformChromeSafariBrowserCreationParams params,
) { ) {
throw UnimplementedError( throw UnimplementedError(
'createPlatformChromeSafariBrowser is not implemented on the current platform.'); 'createPlatformChromeSafariBrowser is not implemented on the current platform.');
} }

View File

@ -53,8 +53,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformCookieManager.implementation(this.params) PlatformCookieManager.implementation(this.params) : super(token: _token);
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();

View File

@ -27,16 +27,18 @@ class PlatformHttpAuthCredentialDatabaseCreationParams {
///- MacOS ///- MacOS
abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface { abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
/// Creates a new [PlatformHttpAuthCredentialDatabase] /// Creates a new [PlatformHttpAuthCredentialDatabase]
factory PlatformHttpAuthCredentialDatabase(PlatformHttpAuthCredentialDatabaseCreationParams params) { factory PlatformHttpAuthCredentialDatabase(
PlatformHttpAuthCredentialDatabaseCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformHttpAuthCredentialDatabase cookieManager = final PlatformHttpAuthCredentialDatabase cookieManager =
InAppWebViewPlatform.instance!.createPlatformHttpAuthCredentialDatabase(params); InAppWebViewPlatform.instance!
.createPlatformHttpAuthCredentialDatabase(params);
PlatformInterface.verify(cookieManager, _token); PlatformInterface.verify(cookieManager, _token);
return cookieManager; return cookieManager;
} }
@ -63,8 +65,7 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
///- Android native WebView ///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials)) ///- iOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
///- MacOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials)) ///- MacOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
Future<List<URLProtectionSpaceHttpAuthCredentials>> Future<List<URLProtectionSpaceHttpAuthCredentials>> getAllAuthCredentials() {
getAllAuthCredentials() {
throw UnimplementedError( throw UnimplementedError(
'getAllAuthCredentials is not implemented on the current platform'); 'getAllAuthCredentials is not implemented on the current platform');
} }

View File

@ -41,16 +41,18 @@ class PlatformInAppLocalhostServerCreationParams {
///- MacOS ///- MacOS
abstract class PlatformInAppLocalhostServer extends PlatformInterface { abstract class PlatformInAppLocalhostServer extends PlatformInterface {
/// Creates a new [PlatformInAppLocalhostServer] /// Creates a new [PlatformInAppLocalhostServer]
factory PlatformInAppLocalhostServer(PlatformInAppLocalhostServerCreationParams params) { factory PlatformInAppLocalhostServer(
PlatformInAppLocalhostServerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformInAppLocalhostServer inAppLocalhostServer = final PlatformInAppLocalhostServer inAppLocalhostServer =
InAppWebViewPlatform.instance!.createPlatformInAppLocalhostServer(params); InAppWebViewPlatform.instance!
.createPlatformInAppLocalhostServer(params);
PlatformInterface.verify(inAppLocalhostServer, _token); PlatformInterface.verify(inAppLocalhostServer, _token);
return inAppLocalhostServer; return inAppLocalhostServer;
} }

View File

@ -42,16 +42,18 @@ class PlatformProcessGlobalConfigCreationParams {
///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig)) ///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig))
abstract class PlatformProcessGlobalConfig extends PlatformInterface { abstract class PlatformProcessGlobalConfig extends PlatformInterface {
/// Creates a new [PlatformProcessGlobalConfig] /// Creates a new [PlatformProcessGlobalConfig]
factory PlatformProcessGlobalConfig(PlatformProcessGlobalConfigCreationParams params) { factory PlatformProcessGlobalConfig(
PlatformProcessGlobalConfigCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformProcessGlobalConfig processGlobalConfig = final PlatformProcessGlobalConfig processGlobalConfig = InAppWebViewPlatform
InAppWebViewPlatform.instance!.createPlatformProcessGlobalConfig(params); .instance!
.createPlatformProcessGlobalConfig(params);
PlatformInterface.verify(processGlobalConfig, _token); PlatformInterface.verify(processGlobalConfig, _token);
return processGlobalConfig; return processGlobalConfig;
} }

View File

@ -30,16 +30,17 @@ class PlatformProxyControllerCreationParams {
///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController)) ///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController))
abstract class PlatformProxyController extends PlatformInterface { abstract class PlatformProxyController extends PlatformInterface {
/// Creates a new [PlatformProxyController] /// Creates a new [PlatformProxyController]
factory PlatformProxyController(PlatformProxyControllerCreationParams params) { factory PlatformProxyController(
PlatformProxyControllerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformProxyController proxyController = final PlatformProxyController proxyController =
InAppWebViewPlatform.instance!.createPlatformProxyController(params); InAppWebViewPlatform.instance!.createPlatformProxyController(params);
PlatformInterface.verify(proxyController, _token); PlatformInterface.verify(proxyController, _token);
return proxyController; return proxyController;
} }
@ -50,8 +51,7 @@ abstract class PlatformProxyController extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformProxyController.implementation(this.params) PlatformProxyController.implementation(this.params) : super(token: _token);
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();

View File

@ -22,16 +22,18 @@ class PlatformServiceWorkerControllerCreationParams {
///- Android native WebView ([Official API - ServiceWorkerControllerCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat)) ///- Android native WebView ([Official API - ServiceWorkerControllerCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat))
abstract class PlatformServiceWorkerController extends PlatformInterface { abstract class PlatformServiceWorkerController extends PlatformInterface {
/// Creates a new [PlatformServiceWorkerController] /// Creates a new [PlatformServiceWorkerController]
factory PlatformServiceWorkerController(PlatformServiceWorkerControllerCreationParams params) { factory PlatformServiceWorkerController(
PlatformServiceWorkerControllerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformServiceWorkerController serviceWorkerController = final PlatformServiceWorkerController serviceWorkerController =
InAppWebViewPlatform.instance!.createPlatformServiceWorkerController(params); InAppWebViewPlatform.instance!
.createPlatformServiceWorkerController(params);
PlatformInterface.verify(serviceWorkerController, _token); PlatformInterface.verify(serviceWorkerController, _token);
return serviceWorkerController; return serviceWorkerController;
} }
@ -39,14 +41,15 @@ abstract class PlatformServiceWorkerController extends PlatformInterface {
/// Creates a new [PlatformServiceWorkerController] /// Creates a new [PlatformServiceWorkerController]
factory PlatformServiceWorkerController.static() { factory PlatformServiceWorkerController.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformServiceWorkerController serviceWorkerControllerStatic = final PlatformServiceWorkerController serviceWorkerControllerStatic =
InAppWebViewPlatform.instance!.createPlatformServiceWorkerControllerStatic(); InAppWebViewPlatform.instance!
.createPlatformServiceWorkerControllerStatic();
PlatformInterface.verify(serviceWorkerControllerStatic, _token); PlatformInterface.verify(serviceWorkerControllerStatic, _token);
return serviceWorkerControllerStatic; return serviceWorkerControllerStatic;
} }
@ -188,4 +191,3 @@ class ServiceWorkerClient {
ServiceWorkerClient({this.shouldInterceptRequest}); ServiceWorkerClient({this.shouldInterceptRequest});
} }

View File

@ -29,16 +29,17 @@ class PlatformTracingControllerCreationParams {
///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController)) ///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController))
abstract class PlatformTracingController extends PlatformInterface { abstract class PlatformTracingController extends PlatformInterface {
/// Creates a new [PlatformTracingController] /// Creates a new [PlatformTracingController]
factory PlatformTracingController(PlatformTracingControllerCreationParams params) { factory PlatformTracingController(
PlatformTracingControllerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformTracingController tracingController = final PlatformTracingController tracingController =
InAppWebViewPlatform.instance!.createPlatformTracingController(params); InAppWebViewPlatform.instance!.createPlatformTracingController(params);
PlatformInterface.verify(tracingController, _token); PlatformInterface.verify(tracingController, _token);
return tracingController; return tracingController;
} }
@ -49,8 +50,7 @@ abstract class PlatformTracingController extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformTracingController.implementation(this.params) PlatformTracingController.implementation(this.params) : super(token: _token);
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();
@ -80,8 +80,7 @@ abstract class PlatformTracingController extends PlatformInterface {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.stop](https://developer.android.com/reference/android/webkit/TracingController#stop(java.io.OutputStream,%20java.util.concurrent.Executor))) ///- Android native WebView ([Official API - TracingController.stop](https://developer.android.com/reference/android/webkit/TracingController#stop(java.io.OutputStream,%20java.util.concurrent.Executor)))
Future<bool> stop({String? filePath}) { Future<bool> stop({String? filePath}) {
throw UnimplementedError( throw UnimplementedError('stop is not implemented on the current platform');
'stop is not implemented on the current platform');
} }
///Returns whether the WebView framework is tracing. ///Returns whether the WebView framework is tracing.

View File

@ -43,8 +43,7 @@ class WebViewAssetLoader_ {
abstract class IPathHandler { abstract class IPathHandler {
String get path { String get path {
throw UnimplementedError( throw UnimplementedError('path is not implemented on the current platform');
'path is not implemented on the current platform');
} }
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
@ -74,7 +73,8 @@ class PlatformPathHandlerCreationParams {
///A handler that produces responses for a registered path. ///A handler that produces responses for a registered path.
/// ///
///Implement this interface to handle other use-cases according to your app's needs. ///Implement this interface to handle other use-cases according to your app's needs.
abstract class PlatformPathHandler extends PlatformInterface implements IPathHandler { abstract class PlatformPathHandler extends PlatformInterface
implements IPathHandler {
/// Creates a new [PlatformWebViewAssetLoader] /// Creates a new [PlatformWebViewAssetLoader]
factory PlatformPathHandler(PlatformPathHandlerCreationParams params) { factory PlatformPathHandler(PlatformPathHandlerCreationParams params) {
assert( assert(

View File

@ -24,14 +24,14 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
/// Creates a new [PlatformWebViewFeature] /// Creates a new [PlatformWebViewFeature]
factory PlatformWebViewFeature(PlatformWebViewFeatureCreationParams params) { factory PlatformWebViewFeature(PlatformWebViewFeatureCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebViewFeature webViewFeature = final PlatformWebViewFeature webViewFeature =
InAppWebViewPlatform.instance!.createPlatformWebViewFeature(params); InAppWebViewPlatform.instance!.createPlatformWebViewFeature(params);
PlatformInterface.verify(webViewFeature, _token); PlatformInterface.verify(webViewFeature, _token);
return webViewFeature; return webViewFeature;
} }
@ -39,14 +39,14 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
/// Creates a new empty [PlatformWebViewFeature] to access static methods. /// Creates a new empty [PlatformWebViewFeature] to access static methods.
factory PlatformWebViewFeature.static() { factory PlatformWebViewFeature.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`WebViewPlatform.instance` before use. For unit testing, ' '`WebViewPlatform.instance` before use. For unit testing, '
'`WebViewPlatform.instance` can be set with your own test implementation.', '`WebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebViewFeature webViewFeatureStatic = final PlatformWebViewFeature webViewFeatureStatic =
InAppWebViewPlatform.instance!.createPlatformWebViewFeatureStatic(); InAppWebViewPlatform.instance!.createPlatformWebViewFeatureStatic();
PlatformInterface.verify(webViewFeatureStatic, _token); PlatformInterface.verify(webViewFeatureStatic, _token);
return webViewFeatureStatic; return webViewFeatureStatic;
} }
@ -57,8 +57,7 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformWebViewFeature.implementation(this.params) PlatformWebViewFeature.implementation(this.params) : super(token: _token);
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();
@ -98,8 +97,7 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
///any callback guarded by that feature will not be invoked. ///any callback guarded by that feature will not be invoked.
/// ///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
Future<bool> isStartupFeatureSupported( Future<bool> isStartupFeatureSupported(WebViewFeature startupFeature) {
WebViewFeature startupFeature) {
throw UnimplementedError( throw UnimplementedError(
'isStartupFeatureSupported is not implemented on the current platform'); 'isStartupFeatureSupported is not implemented on the current platform');
} }
@ -121,216 +119,216 @@ class WebViewFeature_ {
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.createWebMessageChannel]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.createWebMessageChannel].
static const CREATE_WEB_MESSAGE_CHANNEL = static const CREATE_WEB_MESSAGE_CHANNEL =
const WebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL"); const WebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.disabledActionModeMenuItems]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.disabledActionModeMenuItems].
static const DISABLED_ACTION_MODE_MENU_ITEMS = static const DISABLED_ACTION_MODE_MENU_ITEMS =
const WebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS"); const WebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDark]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDark].
static const FORCE_DARK = const WebViewFeature_._internal("FORCE_DARK"); static const FORCE_DARK = const WebViewFeature_._internal("FORCE_DARK");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDarkStrategy]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDarkStrategy].
static const FORCE_DARK_STRATEGY = static const FORCE_DARK_STRATEGY =
const WebViewFeature_._internal("FORCE_DARK_STRATEGY"); const WebViewFeature_._internal("FORCE_DARK_STRATEGY");
/// ///
static const GET_WEB_CHROME_CLIENT = static const GET_WEB_CHROME_CLIENT =
const WebViewFeature_._internal("GET_WEB_CHROME_CLIENT"); const WebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
/// ///
static const GET_WEB_VIEW_CLIENT = static const GET_WEB_VIEW_CLIENT =
const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT"); const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
/// ///
static const GET_WEB_VIEW_RENDERER = static const GET_WEB_VIEW_RENDERER =
const WebViewFeature_._internal("GET_WEB_VIEW_RENDERER"); const WebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
/// ///
static const MULTI_PROCESS = const WebViewFeature_._internal("MULTI_PROCESS"); static const MULTI_PROCESS = const WebViewFeature_._internal("MULTI_PROCESS");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.offscreenPreRaster]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.offscreenPreRaster].
static const OFF_SCREEN_PRERASTER = static const OFF_SCREEN_PRERASTER =
const WebViewFeature_._internal("OFF_SCREEN_PRERASTER"); const WebViewFeature_._internal("OFF_SCREEN_PRERASTER");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.postWebMessage]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.postWebMessage].
static const POST_WEB_MESSAGE = static const POST_WEB_MESSAGE =
const WebViewFeature_._internal("POST_WEB_MESSAGE"); const WebViewFeature_._internal("POST_WEB_MESSAGE");
///Feature for [isFeatureSupported]. This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride]. ///Feature for [isFeatureSupported]. This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride].
static const PROXY_OVERRIDE = static const PROXY_OVERRIDE =
const WebViewFeature_._internal("PROXY_OVERRIDE"); const WebViewFeature_._internal("PROXY_OVERRIDE");
///Feature for [isFeatureSupported]. This feature covers [ProxySettings.reverseBypassEnabled]. ///Feature for [isFeatureSupported]. This feature covers [ProxySettings.reverseBypassEnabled].
static const PROXY_OVERRIDE_REVERSE_BYPASS = static const PROXY_OVERRIDE_REVERSE_BYPASS =
const WebViewFeature_._internal("PROXY_OVERRIDE_REVERSE_BYPASS"); const WebViewFeature_._internal("PROXY_OVERRIDE_REVERSE_BYPASS");
/// ///
static const RECEIVE_HTTP_ERROR = static const RECEIVE_HTTP_ERROR =
const WebViewFeature_._internal("RECEIVE_HTTP_ERROR"); const WebViewFeature_._internal("RECEIVE_HTTP_ERROR");
/// ///
static const RECEIVE_WEB_RESOURCE_ERROR = static const RECEIVE_WEB_RESOURCE_ERROR =
const WebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR"); const WebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.setSafeBrowsingAllowlist]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
static const SAFE_BROWSING_ALLOWLIST = static const SAFE_BROWSING_ALLOWLIST =
const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST"); const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.safeBrowsingEnabled]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.safeBrowsingEnabled].
static const SAFE_BROWSING_ENABLE = static const SAFE_BROWSING_ENABLE =
const WebViewFeature_._internal("SAFE_BROWSING_ENABLE"); const WebViewFeature_._internal("SAFE_BROWSING_ENABLE");
/// ///
static const SAFE_BROWSING_HIT = static const SAFE_BROWSING_HIT =
const WebViewFeature_._internal("SAFE_BROWSING_HIT"); const WebViewFeature_._internal("SAFE_BROWSING_HIT");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl].
static const SAFE_BROWSING_PRIVACY_POLICY_URL = static const SAFE_BROWSING_PRIVACY_POLICY_URL =
const WebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL"); const WebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
/// ///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
/// ///
static const SAFE_BROWSING_RESPONSE_PROCEED = static const SAFE_BROWSING_RESPONSE_PROCEED =
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED"); const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
/// ///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL = static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
const WebViewFeature_._internal( const WebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
///Use [SAFE_BROWSING_ALLOWLIST] instead. ///Use [SAFE_BROWSING_ALLOWLIST] instead.
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
static const SAFE_BROWSING_WHITELIST = static const SAFE_BROWSING_WHITELIST =
const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST"); const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController].
static const SERVICE_WORKER_BASIC_USAGE = static const SERVICE_WORKER_BASIC_USAGE =
const WebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE"); const WebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads].
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
const WebViewFeature_._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS"); const WebViewFeature_._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode].
static const SERVICE_WORKER_CACHE_MODE = static const SERVICE_WORKER_CACHE_MODE =
const WebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE"); const WebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess].
static const SERVICE_WORKER_CONTENT_ACCESS = static const SERVICE_WORKER_CONTENT_ACCESS =
const WebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS"); const WebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess].
static const SERVICE_WORKER_FILE_ACCESS = static const SERVICE_WORKER_FILE_ACCESS =
const WebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS"); const WebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerClient.shouldInterceptRequest]. ///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerClient.shouldInterceptRequest].
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
const WebViewFeature_._internal( const WebViewFeature_._internal(
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"); "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
/// ///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = static const SHOULD_OVERRIDE_WITH_REDIRECTS =
const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.startSafeBrowsing]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.startSafeBrowsing].
static const START_SAFE_BROWSING = static const START_SAFE_BROWSING =
const WebViewFeature_._internal("START_SAFE_BROWSING"); const WebViewFeature_._internal("START_SAFE_BROWSING");
/// ///
static const TRACING_CONTROLLER_BASIC_USAGE = static const TRACING_CONTROLLER_BASIC_USAGE =
const WebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE"); const WebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
/// ///
static const VISUAL_STATE_CALLBACK = static const VISUAL_STATE_CALLBACK =
const WebViewFeature_._internal("VISUAL_STATE_CALLBACK"); const WebViewFeature_._internal("VISUAL_STATE_CALLBACK");
/// ///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
const WebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE"); const WebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
///Feature for [isFeatureSupported]. This feature covers [WebMessageListener]. ///Feature for [isFeatureSupported]. This feature covers [WebMessageListener].
static const WEB_MESSAGE_LISTENER = static const WEB_MESSAGE_LISTENER =
const WebViewFeature_._internal("WEB_MESSAGE_LISTENER"); const WebViewFeature_._internal("WEB_MESSAGE_LISTENER");
/// ///
static const WEB_MESSAGE_PORT_CLOSE = static const WEB_MESSAGE_PORT_CLOSE =
const WebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
/// ///
static const WEB_MESSAGE_PORT_POST_MESSAGE = static const WEB_MESSAGE_PORT_POST_MESSAGE =
const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
/// ///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
const WebViewFeature_._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
/// ///
static const WEB_RESOURCE_ERROR_GET_CODE = static const WEB_RESOURCE_ERROR_GET_CODE =
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE"); const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
/// ///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION"); const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
/// ///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT"); const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
/// ///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
const WebViewFeature_._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE"); const WebViewFeature_._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
/// ///
static const WEB_VIEW_RENDERER_TERMINATE = static const WEB_VIEW_RENDERER_TERMINATE =
const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE"); const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START]. ///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
static const DOCUMENT_START_SCRIPT = static const DOCUMENT_START_SCRIPT =
const WebViewFeature_._internal("DOCUMENT_START_SCRIPT"); const WebViewFeature_._internal("DOCUMENT_START_SCRIPT");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage].
static const SUPPRESS_ERROR_PAGE = static const SUPPRESS_ERROR_PAGE =
const WebViewFeature_._internal("SUPPRESS_ERROR_PAGE"); const WebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
static const ALGORITHMIC_DARKENING = static const ALGORITHMIC_DARKENING =
const WebViewFeature_._internal("ALGORITHMIC_DARKENING"); const WebViewFeature_._internal("ALGORITHMIC_DARKENING");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY = static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
const WebViewFeature_._internal( const WebViewFeature_._internal(
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY"); "ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getVariationsHeader]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getVariationsHeader].
static const GET_VARIATIONS_HEADER = static const GET_VARIATIONS_HEADER =
const WebViewFeature_._internal("GET_VARIATIONS_HEADER"); const WebViewFeature_._internal("GET_VARIATIONS_HEADER");
///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods. ///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods.
static const GET_COOKIE_INFO = static const GET_COOKIE_INFO =
const WebViewFeature_._internal("GET_COOKIE_INFO"); const WebViewFeature_._internal("GET_COOKIE_INFO");
///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods. ///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods.
static const REQUESTED_WITH_HEADER_ALLOW_LIST = static const REQUESTED_WITH_HEADER_ALLOW_LIST =
const WebViewFeature_._internal("REQUESTED_WITH_HEADER_ALLOW_LIST"); const WebViewFeature_._internal("REQUESTED_WITH_HEADER_ALLOW_LIST");
///Feature for [isFeatureSupported]. This feature covers [WebMessagePort.postMessage] with `ArrayBuffer` type, ///Feature for [isFeatureSupported]. This feature covers [WebMessagePort.postMessage] with `ArrayBuffer` type,
///[InAppWebViewController.postWebMessage] with `ArrayBuffer` type, and [JavaScriptReplyProxy.postMessage] with `ArrayBuffer` type. ///[InAppWebViewController.postWebMessage] with `ArrayBuffer` type, and [JavaScriptReplyProxy.postMessage] with `ArrayBuffer` type.
static const WEB_MESSAGE_ARRAY_BUFFER = static const WEB_MESSAGE_ARRAY_BUFFER =
const WebViewFeature_._internal("WEB_MESSAGE_ARRAY_BUFFER"); const WebViewFeature_._internal("WEB_MESSAGE_ARRAY_BUFFER");
///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.dataDirectorySuffix]. ///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.dataDirectorySuffix].
static const STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX = static const STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX =
const WebViewFeature_._internal( const WebViewFeature_._internal(
"STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX"); "STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX");
///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.directoryBasePaths]. ///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.directoryBasePaths].
static const STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS = static const STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS =
const WebViewFeature_._internal( const WebViewFeature_._internal(
"STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS"); "STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS");
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
@ -364,7 +362,7 @@ class WebViewFeature_ {
/// ///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
static Future<bool> isStartupFeatureSupported( static Future<bool> isStartupFeatureSupported(
WebViewFeature startupFeature) => WebViewFeature startupFeature) =>
PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature); PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature);
} }
@ -383,198 +381,198 @@ class AndroidWebViewFeature_ {
/// ///
static const CREATE_WEB_MESSAGE_CHANNEL = static const CREATE_WEB_MESSAGE_CHANNEL =
const AndroidWebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL"); const AndroidWebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
/// ///
static const DISABLED_ACTION_MODE_MENU_ITEMS = static const DISABLED_ACTION_MODE_MENU_ITEMS =
const AndroidWebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS"); const AndroidWebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
/// ///
static const FORCE_DARK = static const FORCE_DARK =
const AndroidWebViewFeature_._internal("FORCE_DARK"); const AndroidWebViewFeature_._internal("FORCE_DARK");
/// ///
static const FORCE_DARK_STRATEGY = static const FORCE_DARK_STRATEGY =
const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY"); const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY");
/// ///
static const GET_WEB_CHROME_CLIENT = static const GET_WEB_CHROME_CLIENT =
const AndroidWebViewFeature_._internal("GET_WEB_CHROME_CLIENT"); const AndroidWebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
/// ///
static const GET_WEB_VIEW_CLIENT = static const GET_WEB_VIEW_CLIENT =
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT"); const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
/// ///
static const GET_WEB_VIEW_RENDERER = static const GET_WEB_VIEW_RENDERER =
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER"); const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
/// ///
static const MULTI_PROCESS = static const MULTI_PROCESS =
const AndroidWebViewFeature_._internal("MULTI_PROCESS"); const AndroidWebViewFeature_._internal("MULTI_PROCESS");
/// ///
static const OFF_SCREEN_PRERASTER = static const OFF_SCREEN_PRERASTER =
const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER"); const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER");
/// ///
static const POST_WEB_MESSAGE = static const POST_WEB_MESSAGE =
const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE"); const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE");
/// ///
static const PROXY_OVERRIDE = static const PROXY_OVERRIDE =
const AndroidWebViewFeature_._internal("PROXY_OVERRIDE"); const AndroidWebViewFeature_._internal("PROXY_OVERRIDE");
/// ///
static const RECEIVE_HTTP_ERROR = static const RECEIVE_HTTP_ERROR =
const AndroidWebViewFeature_._internal("RECEIVE_HTTP_ERROR"); const AndroidWebViewFeature_._internal("RECEIVE_HTTP_ERROR");
/// ///
static const RECEIVE_WEB_RESOURCE_ERROR = static const RECEIVE_WEB_RESOURCE_ERROR =
const AndroidWebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR"); const AndroidWebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
/// ///
static const SAFE_BROWSING_ALLOWLIST = static const SAFE_BROWSING_ALLOWLIST =
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
/// ///
static const SAFE_BROWSING_ENABLE = static const SAFE_BROWSING_ENABLE =
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE");
/// ///
static const SAFE_BROWSING_HIT = static const SAFE_BROWSING_HIT =
const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT");
/// ///
static const SAFE_BROWSING_PRIVACY_POLICY_URL = static const SAFE_BROWSING_PRIVACY_POLICY_URL =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"SAFE_BROWSING_PRIVACY_POLICY_URL"); "SAFE_BROWSING_PRIVACY_POLICY_URL");
/// ///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); "SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
/// ///
static const SAFE_BROWSING_RESPONSE_PROCEED = static const SAFE_BROWSING_RESPONSE_PROCEED =
const AndroidWebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
/// ///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL = static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
///Use [SAFE_BROWSING_ALLOWLIST] instead. ///Use [SAFE_BROWSING_ALLOWLIST] instead.
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
static const SAFE_BROWSING_WHITELIST = static const SAFE_BROWSING_WHITELIST =
const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
/// ///
static const SERVICE_WORKER_BASIC_USAGE = static const SERVICE_WORKER_BASIC_USAGE =
const AndroidWebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
/// ///
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"SERVICE_WORKER_BLOCK_NETWORK_LOADS"); "SERVICE_WORKER_BLOCK_NETWORK_LOADS");
/// ///
static const SERVICE_WORKER_CACHE_MODE = static const SERVICE_WORKER_CACHE_MODE =
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
/// ///
static const SERVICE_WORKER_CONTENT_ACCESS = static const SERVICE_WORKER_CONTENT_ACCESS =
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
/// ///
static const SERVICE_WORKER_FILE_ACCESS = static const SERVICE_WORKER_FILE_ACCESS =
const AndroidWebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
/// ///
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"); "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
/// ///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = static const SHOULD_OVERRIDE_WITH_REDIRECTS =
const AndroidWebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); const AndroidWebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
/// ///
static const START_SAFE_BROWSING = static const START_SAFE_BROWSING =
const AndroidWebViewFeature_._internal("START_SAFE_BROWSING"); const AndroidWebViewFeature_._internal("START_SAFE_BROWSING");
/// ///
static const TRACING_CONTROLLER_BASIC_USAGE = static const TRACING_CONTROLLER_BASIC_USAGE =
const AndroidWebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE"); const AndroidWebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
/// ///
static const VISUAL_STATE_CALLBACK = static const VISUAL_STATE_CALLBACK =
const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK"); const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK");
/// ///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
const AndroidWebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
/// ///
static const WEB_MESSAGE_LISTENER = static const WEB_MESSAGE_LISTENER =
const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER");
/// ///
static const WEB_MESSAGE_PORT_CLOSE = static const WEB_MESSAGE_PORT_CLOSE =
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
/// ///
static const WEB_MESSAGE_PORT_POST_MESSAGE = static const WEB_MESSAGE_PORT_POST_MESSAGE =
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
/// ///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK"); "WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
/// ///
static const WEB_RESOURCE_ERROR_GET_CODE = static const WEB_RESOURCE_ERROR_GET_CODE =
const AndroidWebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE"); const AndroidWebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
/// ///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"WEB_RESOURCE_ERROR_GET_DESCRIPTION"); "WEB_RESOURCE_ERROR_GET_DESCRIPTION");
/// ///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"WEB_RESOURCE_REQUEST_IS_REDIRECT"); "WEB_RESOURCE_REQUEST_IS_REDIRECT");
/// ///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE"); "WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
/// ///
static const WEB_VIEW_RENDERER_TERMINATE = static const WEB_VIEW_RENDERER_TERMINATE =
const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE"); const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START]. ///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
static const DOCUMENT_START_SCRIPT = static const DOCUMENT_START_SCRIPT =
const AndroidWebViewFeature_._internal("DOCUMENT_START_SCRIPT"); const AndroidWebViewFeature_._internal("DOCUMENT_START_SCRIPT");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage].
static const SUPPRESS_ERROR_PAGE = static const SUPPRESS_ERROR_PAGE =
const AndroidWebViewFeature_._internal("SUPPRESS_ERROR_PAGE"); const AndroidWebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
static const ALGORITHMIC_DARKENING = static const ALGORITHMIC_DARKENING =
const AndroidWebViewFeature_._internal("ALGORITHMIC_DARKENING"); const AndroidWebViewFeature_._internal("ALGORITHMIC_DARKENING");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.requestedWithHeaderMode]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
static const REQUESTED_WITH_HEADER_CONTROL = static const REQUESTED_WITH_HEADER_CONTROL =
const AndroidWebViewFeature_._internal("REQUESTED_WITH_HEADER_CONTROL"); const AndroidWebViewFeature_._internal("REQUESTED_WITH_HEADER_CONTROL");
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled]. ///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY = static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
const AndroidWebViewFeature_._internal( const AndroidWebViewFeature_._internal(
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY"); "ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,

View File

@ -15,10 +15,11 @@ import 'pull_to_refresh_settings.dart';
/// this class. /// this class.
class PlatformPullToRefreshControllerCreationParams { class PlatformPullToRefreshControllerCreationParams {
/// Used by the platform implementation to create a new [PlatformPullToRefreshController]. /// Used by the platform implementation to create a new [PlatformPullToRefreshController].
PlatformPullToRefreshControllerCreationParams({ PlatformPullToRefreshControllerCreationParams(
@Deprecated("Use settings instead") PullToRefreshOptions? options, {@Deprecated("Use settings instead") PullToRefreshOptions? options,
PullToRefreshSettings? settings, PullToRefreshSettings? settings,
this.onRefresh}) : this.options = options ?? PullToRefreshOptions(), this.onRefresh})
: this.options = options ?? PullToRefreshOptions(),
this.settings = settings ?? PullToRefreshSettings(); this.settings = settings ?? PullToRefreshSettings();
@Deprecated("Use settings instead") @Deprecated("Use settings instead")
@ -40,7 +41,8 @@ class PlatformPullToRefreshControllerCreationParams {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ///- Android native WebView
///- iOS ///- iOS
abstract class PlatformPullToRefreshController extends PlatformInterface implements Disposable { abstract class PlatformPullToRefreshController extends PlatformInterface
implements Disposable {
///Debug settings. ///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -48,14 +50,15 @@ abstract class PlatformPullToRefreshController extends PlatformInterface impleme
factory PlatformPullToRefreshController( factory PlatformPullToRefreshController(
PlatformPullToRefreshControllerCreationParams params) { PlatformPullToRefreshControllerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformPullToRefreshController webViewControllerDelegate = final PlatformPullToRefreshController webViewControllerDelegate =
InAppWebViewPlatform.instance!.createPlatformPullToRefreshController(params); InAppWebViewPlatform.instance!
.createPlatformPullToRefreshController(params);
PlatformInterface.verify(webViewControllerDelegate, _token); PlatformInterface.verify(webViewControllerDelegate, _token);
return webViewControllerDelegate; return webViewControllerDelegate;
} }
@ -65,7 +68,8 @@ abstract class PlatformPullToRefreshController extends PlatformInterface impleme
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformPullToRefreshController.implementation(this.params) : super(token: _token); PlatformPullToRefreshController.implementation(this.params)
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_authentication_challenge.dart'; import 'url_authentication_challenge.dart';
import 'url_protection_space.dart'; import 'url_protection_space.dart';

View File

@ -1,8 +1,6 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../util.dart'; import '../util.dart';
import 'client_cert_response_action.dart'; import 'client_cert_response_action.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'console_message_level.dart'; import 'console_message_level.dart';
part 'console_message.g.dart'; part 'console_message.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'navigation_action.dart'; import 'navigation_action.dart';
import 'window_features.dart'; import 'window_features.dart';
import 'url_request.dart'; import 'url_request.dart';

View File

@ -2,8 +2,6 @@ import 'dart:typed_data';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'custom_scheme_response.g.dart'; part 'custom_scheme_response.g.dart';
///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event. ///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'download_start_request.g.dart'; part 'download_start_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'force_dark_strategy.g.dart'; part 'force_dark_strategy.g.dart';
///Class used to indicate how `WebView` content should be darkened. ///Class used to indicate how `WebView` content should be darkened.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'form_resubmission_action.g.dart'; part 'form_resubmission_action.g.dart';
///Class that represents the action to take used by the [WebView.onFormResubmission] event. ///Class that represents the action to take used by the [WebView.onFormResubmission] event.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'geolocation_permission_show_prompt_response.g.dart'; part 'geolocation_permission_show_prompt_response.g.dart';
///Class used by the host application to set the Geolocation permission state for an origin during the [WebView.onGeolocationPermissionsShowPrompt] event. ///Class used by the host application to set the Geolocation permission state for an origin during the [WebView.onGeolocationPermissionsShowPrompt] event.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'http_auth_response_action.dart'; import 'http_auth_response_action.dart';
part 'http_auth_response.g.dart'; part 'http_auth_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_credential.dart'; import 'url_credential.dart';
import 'url_response.dart'; import 'url_response.dart';
import 'url_authentication_challenge.dart'; import 'url_authentication_challenge.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'in_app_webview_initial_data.g.dart'; part 'in_app_webview_initial_data.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'js_alert_request.g.dart'; part 'js_alert_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'js_alert_response_action.dart'; import 'js_alert_response_action.dart';
part 'js_alert_response.g.dart'; part 'js_alert_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'js_before_unload_request.g.dart'; part 'js_before_unload_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'js_before_unload_response_action.dart'; import 'js_before_unload_response_action.dart';
part 'js_before_unload_response.g.dart'; part 'js_before_unload_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'js_confirm_request.g.dart'; part 'js_confirm_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'js_confirm_response_action.dart'; import 'js_confirm_response_action.dart';
part 'js_confirm_response.g.dart'; part 'js_confirm_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'js_prompt_request.g.dart'; part 'js_prompt_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'js_prompt_response_action.dart'; import 'js_prompt_response_action.dart';
part 'js_prompt_response.g.dart'; part 'js_prompt_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'loaded_resource.g.dart'; part 'loaded_resource.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'login_request.g.dart'; part 'login_request.g.dart';
///Class used by [WebView.onReceivedLoginRequest] event. ///Class used by [WebView.onReceivedLoginRequest] event.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_request.dart'; import 'url_request.dart';
import 'navigation_type.dart'; import 'navigation_type.dart';
import 'frame_info.dart'; import 'frame_info.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'navigation_action_policy.g.dart'; part 'navigation_action_policy.g.dart';
///Class that is used by [WebView.shouldOverrideUrlLoading] event. ///Class that is used by [WebView.shouldOverrideUrlLoading] event.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_response.dart'; import 'url_response.dart';
part 'navigation_response.g.dart'; part 'navigation_response.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'navigation_response_action.g.dart'; part 'navigation_response_action.g.dart';
///Class that is used by [WebView.onNavigationResponse] event. ///Class that is used by [WebView.onNavigationResponse] event.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'navigation_type.g.dart'; part 'navigation_type.g.dart';
///Class that represents the type of action triggering a navigation for the [WebView.shouldOverrideUrlLoading] event. ///Class that represents the type of action triggering a navigation for the [WebView.shouldOverrideUrlLoading] event.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'over_scroll_mode.g.dart'; part 'over_scroll_mode.g.dart';
///Class used to configure the `WebView`'s over-scroll mode. ///Class used to configure the `WebView`'s over-scroll mode.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'in_app_webview_rect.dart'; import 'in_app_webview_rect.dart';
part 'pdf_configuration.g.dart'; part 'pdf_configuration.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
import 'permission_resource_type.dart'; import 'permission_resource_type.dart';
import 'permission_response.dart'; import 'permission_response.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'permission_resource_type.dart'; import 'permission_resource_type.dart';
import 'permission_response_action.dart'; import 'permission_response_action.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'renderer_priority.dart'; import 'renderer_priority.dart';
part 'render_process_gone_detail.g.dart'; part 'render_process_gone_detail.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'renderer_priority.dart'; import 'renderer_priority.dart';
part 'renderer_priority_policy.g.dart'; part 'renderer_priority_policy.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_inappwebview_controller.dart'; import '../in_app_webview/platform_inappwebview_controller.dart';
import 'safe_browsing_response_action.dart'; import 'safe_browsing_response_action.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_inappwebview_controller.dart'; import '../in_app_webview/platform_inappwebview_controller.dart';
import 'in_app_webview_rect.dart'; import 'in_app_webview_rect.dart';
import 'compress_format.dart'; import 'compress_format.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'server_trust_auth_response_action.dart'; import 'server_trust_auth_response_action.dart';
part 'server_trust_auth_response.g.dart'; part 'server_trust_auth_response.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_authentication_challenge.dart'; import 'url_authentication_challenge.dart';
import 'url_protection_space.dart'; import 'url_protection_space.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'should_allow_deprecated_tls_action.g.dart'; part 'should_allow_deprecated_tls_action.g.dart';
///Class that is used by [WebView.shouldAllowDeprecatedTLS] event. ///Class that is used by [WebView.shouldAllowDeprecatedTLS] event.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'user_script_injection_time.dart'; import 'user_script_injection_time.dart';
import 'content_world.dart'; import 'content_world.dart';
import '../platform_webview_feature.dart'; import '../platform_webview_feature.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'user_script.dart'; import 'user_script.dart';
part 'user_script_injection_time.g.dart'; part 'user_script_injection_time.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'web_history_item.dart'; import 'web_history_item.dart';
part 'web_history.g.dart'; part 'web_history.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
import 'web_history.dart'; import 'web_history.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart'; import '../web_uri.dart';
part 'web_resource_request.g.dart'; part 'web_resource_request.g.dart';

View File

@ -2,8 +2,6 @@ import 'dart:typed_data';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'web_resource_response.g.dart'; part 'web_resource_response.g.dart';
///Class representing a resource response of the `WebView`. ///Class representing a resource response of the `WebView`.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'webview_package_info.g.dart'; part 'webview_package_info.g.dart';
///Class that represents a `WebView` package info. ///Class that represents a `WebView` package info.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'webview_render_process_action.g.dart'; part 'webview_render_process_action.g.dart';
///Class that represents the action to take used by the [WebView.onRenderProcessUnresponsive] and [WebView.onRenderProcessResponsive] event ///Class that represents the action to take used by the [WebView.onRenderProcessUnresponsive] and [WebView.onRenderProcessResponsive] event

View File

@ -66,7 +66,8 @@ class PlatformWebAuthenticationSessionCreationParams {
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- iOS ///- iOS
///- MacOS ///- MacOS
abstract class PlatformWebAuthenticationSession extends PlatformInterface implements Disposable { abstract class PlatformWebAuthenticationSession extends PlatformInterface
implements Disposable {
///Debug settings. ///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -74,14 +75,15 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
factory PlatformWebAuthenticationSession( factory PlatformWebAuthenticationSession(
PlatformWebAuthenticationSessionCreationParams params) { PlatformWebAuthenticationSessionCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebAuthenticationSession webAuthenticationSession = final PlatformWebAuthenticationSession webAuthenticationSession =
InAppWebViewPlatform.instance!.createPlatformWebAuthenticationSession(params); InAppWebViewPlatform.instance!
.createPlatformWebAuthenticationSession(params);
PlatformInterface.verify(webAuthenticationSession, _token); PlatformInterface.verify(webAuthenticationSession, _token);
return webAuthenticationSession; return webAuthenticationSession;
} }
@ -89,14 +91,15 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
/// Creates a new [PlatformWebAuthenticationSession] to access static methods. /// Creates a new [PlatformWebAuthenticationSession] to access static methods.
factory PlatformWebAuthenticationSession.static() { factory PlatformWebAuthenticationSession.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebAuthenticationSession webAuthenticationSessionStatic = final PlatformWebAuthenticationSession webAuthenticationSessionStatic =
InAppWebViewPlatform.instance!.createPlatformWebAuthenticationSessionStatic(); InAppWebViewPlatform.instance!
.createPlatformWebAuthenticationSessionStatic();
PlatformInterface.verify(webAuthenticationSessionStatic, _token); PlatformInterface.verify(webAuthenticationSessionStatic, _token);
return webAuthenticationSessionStatic; return webAuthenticationSessionStatic;
} }
@ -106,7 +109,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformWebAuthenticationSession.implementation(this.params) : super(token: _token); PlatformWebAuthenticationSession.implementation(this.params)
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();
@ -131,7 +135,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.initialSettings} ///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.initialSettings}
///Initial settings. ///Initial settings.
///{@endtemplate} ///{@endtemplate}
WebAuthenticationSessionSettings? get initialSettings => params.initialSettings; WebAuthenticationSessionSettings? get initialSettings =>
params.initialSettings;
///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.onComplete} ///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.onComplete}
///A completion handler the session calls when it completes successfully, or when the user cancels the session. ///A completion handler the session calls when it completes successfully, or when the user cancels the session.

View File

@ -56,14 +56,14 @@ abstract class PlatformWebMessageChannel extends PlatformInterface
/// Creates a new [PlatformWebMessageChannel] to access static methods. /// Creates a new [PlatformWebMessageChannel] to access static methods.
factory PlatformWebMessageChannel.static() { factory PlatformWebMessageChannel.static() {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebMessageChannel webMessageChannelStatic = final PlatformWebMessageChannel webMessageChannelStatic =
InAppWebViewPlatform.instance!.createPlatformWebMessageChannelStatic(); InAppWebViewPlatform.instance!.createPlatformWebMessageChannelStatic();
PlatformInterface.verify(webMessageChannelStatic, _token); PlatformInterface.verify(webMessageChannelStatic, _token);
return webMessageChannelStatic; return webMessageChannelStatic;
} }
@ -111,4 +111,3 @@ abstract class PlatformWebMessageChannel extends PlatformInterface
return 'PlatformWebMessageChannel{id: $id, port1: $port1, port2: $port2}'; return 'PlatformWebMessageChannel{id: $id, port1: $port1, port2: $port2}';
} }
} }

View File

@ -15,8 +15,8 @@ class PlatformWebMessageListenerCreationParams {
/// Used by the platform implementation to create a new [PlatformWebMessageListener]. /// Used by the platform implementation to create a new [PlatformWebMessageListener].
const PlatformWebMessageListenerCreationParams( const PlatformWebMessageListenerCreationParams(
{required this.jsObjectName, {required this.jsObjectName,
this.allowedOriginRules, this.allowedOriginRules,
this.onPostMessage}); this.onPostMessage});
///{@macro flutter_inappwebview_platform_interface.PlatformWebMessageListener.jsObjectName} ///{@macro flutter_inappwebview_platform_interface.PlatformWebMessageListener.jsObjectName}
final String jsObjectName; final String jsObjectName;
@ -39,19 +39,20 @@ class PlatformWebMessageListenerCreationParams {
///- Android native WebView ///- Android native WebView
///- iOS ///- iOS
///- MacOS ///- MacOS
abstract class PlatformWebMessageListener extends PlatformInterface implements Disposable { abstract class PlatformWebMessageListener extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformWebMessageListener] /// Creates a new [PlatformWebMessageListener]
factory PlatformWebMessageListener( factory PlatformWebMessageListener(
PlatformWebMessageListenerCreationParams params) { PlatformWebMessageListenerCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformWebMessageListener webMessageListener = final PlatformWebMessageListener webMessageListener =
InAppWebViewPlatform.instance!.createPlatformWebMessageListener(params); InAppWebViewPlatform.instance!.createPlatformWebMessageListener(params);
PlatformInterface.verify(webMessageListener, _token); PlatformInterface.verify(webMessageListener, _token);
return webMessageListener; return webMessageListener;
} }
@ -121,7 +122,8 @@ abstract class PlatformWebMessageListener extends PlatformInterface implements D
@immutable @immutable
class PlatformJavaScriptReplyProxyCreationParams { class PlatformJavaScriptReplyProxyCreationParams {
/// Used by the platform implementation to create a new [PlatformJavaScriptReplyProxy]. /// Used by the platform implementation to create a new [PlatformJavaScriptReplyProxy].
const PlatformJavaScriptReplyProxyCreationParams({required this.webMessageListener}); const PlatformJavaScriptReplyProxyCreationParams(
{required this.webMessageListener});
final PlatformWebMessageListener webMessageListener; final PlatformWebMessageListener webMessageListener;
} }
@ -136,14 +138,15 @@ abstract class PlatformJavaScriptReplyProxy extends PlatformInterface {
factory PlatformJavaScriptReplyProxy( factory PlatformJavaScriptReplyProxy(
PlatformJavaScriptReplyProxyCreationParams params) { PlatformJavaScriptReplyProxyCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformJavaScriptReplyProxy javaScriptReplyProxy = final PlatformJavaScriptReplyProxy javaScriptReplyProxy =
InAppWebViewPlatform.instance!.createPlatformJavaScriptReplyProxy(params); InAppWebViewPlatform.instance!
.createPlatformJavaScriptReplyProxy(params);
PlatformInterface.verify(javaScriptReplyProxy, _token); PlatformInterface.verify(javaScriptReplyProxy, _token);
return javaScriptReplyProxy; return javaScriptReplyProxy;
} }
@ -153,7 +156,8 @@ abstract class PlatformJavaScriptReplyProxy extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend /// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor. /// a class that only contains a factory constructor.
@protected @protected
PlatformJavaScriptReplyProxy.implementation(this.params) : super(token: _token); PlatformJavaScriptReplyProxy.implementation(this.params)
: super(token: _token);
static final Object _token = Object(); static final Object _token = Object();

View File

@ -32,7 +32,8 @@ class PlatformWebStorageCreationParams {
///- iOS ///- iOS
///- MacOS ///- MacOS
///- Web ///- Web
abstract class PlatformWebStorage extends PlatformInterface implements Disposable { abstract class PlatformWebStorage extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformWebStorage] /// Creates a new [PlatformWebStorage]
factory PlatformWebStorage(PlatformWebStorageCreationParams params) { factory PlatformWebStorage(PlatformWebStorageCreationParams params) {
assert( assert(
@ -217,7 +218,8 @@ abstract class PlatformStorage extends PlatformInterface implements Disposable {
@override @override
void dispose() { void dispose() {
throw UnimplementedError('dispose is not implemented on the current platform'); throw UnimplementedError(
'dispose is not implemented on the current platform');
} }
} }
@ -280,13 +282,14 @@ abstract class PlatformLocalStorage extends PlatformStorage {
/// Platform specific implementations can add additional fields by extending /// Platform specific implementations can add additional fields by extending
/// this class. /// this class.
@immutable @immutable
class PlatformSessionStorageCreationParams extends PlatformStorageCreationParams { class PlatformSessionStorageCreationParams
extends PlatformStorageCreationParams {
/// Used by the platform implementation to create a new [PlatformSessionStorage]. /// Used by the platform implementation to create a new [PlatformSessionStorage].
const PlatformSessionStorageCreationParams( const PlatformSessionStorageCreationParams(
// This parameter prevents breaking changes later. // This parameter prevents breaking changes later.
// ignore: avoid_unused_constructor_parameters // ignore: avoid_unused_constructor_parameters
PlatformStorageCreationParams params, PlatformStorageCreationParams params,
) : super(webStorageType: WebStorageType.SESSION_STORAGE); ) : super(webStorageType: WebStorageType.SESSION_STORAGE);
/// Creates a [AndroidCookieManagerCreationParams] instance based on [PlatformCookieManagerCreationParams]. /// Creates a [AndroidCookieManagerCreationParams] instance based on [PlatformCookieManagerCreationParams].
factory PlatformSessionStorageCreationParams.fromPlatformStorageCreationParams( factory PlatformSessionStorageCreationParams.fromPlatformStorageCreationParams(
@ -301,14 +304,14 @@ abstract class PlatformSessionStorage extends PlatformStorage {
/// Creates a new [PlatformSessionStorage] /// Creates a new [PlatformSessionStorage]
factory PlatformSessionStorage(PlatformSessionStorageCreationParams params) { factory PlatformSessionStorage(PlatformSessionStorageCreationParams params) {
assert( assert(
InAppWebViewPlatform.instance != null, InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please ' 'A platform implementation for `flutter_inappwebview` has not been set. Please '
'ensure that an implementation of `InAppWebViewPlatform` has been set to ' 'ensure that an implementation of `InAppWebViewPlatform` has been set to '
'`InAppWebViewPlatform.instance` before use. For unit testing, ' '`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.', '`InAppWebViewPlatform.instance` can be set with your own test implementation.',
); );
final PlatformSessionStorage sessionStorage = final PlatformSessionStorage sessionStorage =
InAppWebViewPlatform.instance!.createPlatformSessionStorage(params); InAppWebViewPlatform.instance!.createPlatformSessionStorage(params);
PlatformInterface.verify(sessionStorage, _token); PlatformInterface.verify(sessionStorage, _token);
return sessionStorage; return sessionStorage;
} }
@ -320,11 +323,11 @@ abstract class PlatformSessionStorage extends PlatformStorage {
@protected @protected
PlatformSessionStorage.implementation(PlatformStorageCreationParams params) PlatformSessionStorage.implementation(PlatformStorageCreationParams params)
: super.implementation( : super.implementation(
params is PlatformSessionStorageCreationParams params is PlatformSessionStorageCreationParams
? params ? params
: PlatformSessionStorageCreationParams : PlatformSessionStorageCreationParams
.fromPlatformStorageCreationParams(params), .fromPlatformStorageCreationParams(params),
); );
static final Object _token = Object(); static final Object _token = Object();
} }

View File

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -17,9 +16,6 @@ import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_pla
///- Android ///- Android
///- iOS ///- iOS
class ChromeSafariBrowser implements PlatformChromeSafariBrowserEvents { class ChromeSafariBrowser implements PlatformChromeSafariBrowserEvents {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [ChromeSafariBrowser]. /// Constructs a [ChromeSafariBrowser].
/// ///
/// See [ChromeSafariBrowser.fromPlatformCreationParams] for setting /// See [ChromeSafariBrowser.fromPlatformCreationParams] for setting

View File

@ -5,9 +5,6 @@ import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_pla
///- iOS ///- iOS
///- MacOS ///- MacOS
class FindInteractionController { class FindInteractionController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
FindInteractionController( FindInteractionController(
{void Function(PlatformFindInteractionController controller, {void Function(PlatformFindInteractionController controller,
int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)? int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
@ -31,11 +28,9 @@ class FindInteractionController {
final PlatformFindInteractionController platform; final PlatformFindInteractionController platform;
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.onFindResultReceived} ///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.onFindResultReceived}
void Function( void Function(PlatformFindInteractionController controller,
PlatformFindInteractionController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
int activeMatchOrdinal, get onFindResultReceived => platform.onFindResultReceived;
int numberOfMatches,
bool isDoneCounting)? get onFindResultReceived => platform.onFindResultReceived;
///Finds all instances of find on the page and highlights them. Notifies [FindInteractionController.onFindResultReceived] listener. ///Finds all instances of find on the page and highlights them. Notifies [FindInteractionController.onFindResultReceived] listener.
/// ///

View File

@ -21,9 +21,6 @@ import '../print_job/main.dart';
///- iOS ///- iOS
///- MacOS ///- MacOS
class InAppBrowser implements PlatformInAppBrowserEvents { class InAppBrowser implements PlatformInAppBrowserEvents {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [InAppBrowser]. /// Constructs a [InAppBrowser].
/// ///
/// See [InAppBrowser.fromPlatformCreationParams] for setting /// See [InAppBrowser.fromPlatformCreationParams] for setting

View File

@ -9,7 +9,8 @@ import '../in_app_webview_controller.dart';
class AndroidInAppWebViewController { class AndroidInAppWebViewController {
PlatformInAppWebViewController? _controller; PlatformInAppWebViewController? _controller;
AndroidInAppWebViewController({required PlatformInAppWebViewController controller}) { AndroidInAppWebViewController(
{required PlatformInAppWebViewController controller}) {
this._controller = controller; this._controller = controller;
} }

View File

@ -8,7 +8,6 @@ import '../in_app_webview/in_app_webview_controller.dart';
///- iOS ///- iOS
///- MacOS ///- MacOS
class PrintJobController { class PrintJobController {
PrintJobController({required String id, PrintJobCompletionHandler onComplete}) PrintJobController({required String id, PrintJobCompletionHandler onComplete})
: this.fromPlatformCreationParams( : this.fromPlatformCreationParams(
params: PlatformPrintJobControllerCreationParams( params: PlatformPrintJobControllerCreationParams(
@ -57,7 +56,8 @@ class PrintJobController {
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- iOS ///- iOS
Future<void> dismiss({bool animated = true}) => platform.dismiss(animated: animated); Future<void> dismiss({bool animated = true}) =>
platform.dismiss(animated: animated);
///Gets the [PrintJobInfo] that describes this job. ///Gets the [PrintJobInfo] that describes this job.
/// ///

View File

@ -30,14 +30,14 @@ class ProcessGlobalConfig {
/// parameters for a specific platform. /// parameters for a specific platform.
ProcessGlobalConfig() ProcessGlobalConfig()
: this.fromPlatformCreationParams( : this.fromPlatformCreationParams(
const PlatformProcessGlobalConfigCreationParams(), const PlatformProcessGlobalConfigCreationParams(),
); );
/// Constructs a [ProcessGlobalConfig] from creation params for a specific /// Constructs a [ProcessGlobalConfig] from creation params for a specific
/// platform. /// platform.
ProcessGlobalConfig.fromPlatformCreationParams( ProcessGlobalConfig.fromPlatformCreationParams(
PlatformProcessGlobalConfigCreationParams params, PlatformProcessGlobalConfigCreationParams params,
) : this.fromPlatform(PlatformProcessGlobalConfig(params)); ) : this.fromPlatform(PlatformProcessGlobalConfig(params));
/// Constructs a [ProcessGlobalConfig] from a specific platform /// Constructs a [ProcessGlobalConfig] from a specific platform
/// implementation. /// implementation.
@ -63,6 +63,6 @@ class ProcessGlobalConfig {
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig.apply](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig))) ///- Android native WebView ([Official API - ProcessGlobalConfig.apply](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)))
Future<void> apply({required ProcessGlobalConfigSettings settings}) => platform.apply(settings: settings); Future<void> apply({required ProcessGlobalConfigSettings settings}) =>
platform.apply(settings: settings);
} }

View File

@ -18,14 +18,14 @@ class ProxyController {
/// parameters for a specific platform. /// parameters for a specific platform.
ProxyController() ProxyController()
: this.fromPlatformCreationParams( : this.fromPlatformCreationParams(
const PlatformProxyControllerCreationParams(), const PlatformProxyControllerCreationParams(),
); );
/// Constructs a [ProxyController] from creation params for a specific /// Constructs a [ProxyController] from creation params for a specific
/// platform. /// platform.
ProxyController.fromPlatformCreationParams( ProxyController.fromPlatformCreationParams(
PlatformProxyControllerCreationParams params, PlatformProxyControllerCreationParams params,
) : this.fromPlatform(PlatformProxyController(params)); ) : this.fromPlatform(PlatformProxyController(params));
/// Constructs a [ProxyController] from a specific platform /// Constructs a [ProxyController] from a specific platform
/// implementation. /// implementation.
@ -51,7 +51,8 @@ class ProxyController {
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController.setProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable))) ///- Android native WebView ([Official API - ProxyController.setProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable)))
Future<void> setProxyOverride({required ProxySettings settings}) => platform.setProxyOverride(settings: settings); Future<void> setProxyOverride({required ProxySettings settings}) =>
platform.setProxyOverride(settings: settings);
///Clears the proxy settings. ///Clears the proxy settings.
///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page. ///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.

View File

@ -16,9 +16,6 @@ import '../in_app_browser/in_app_browser.dart';
///- Android native WebView ///- Android native WebView
///- iOS ///- iOS
class PullToRefreshController { class PullToRefreshController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
PullToRefreshController( PullToRefreshController(
{void Function()? onRefresh, {void Function()? onRefresh,
@Deprecated("Use settings instead") PullToRefreshOptions? options, @Deprecated("Use settings instead") PullToRefreshOptions? options,

View File

@ -17,14 +17,14 @@ class TracingController {
/// parameters for a specific platform. /// parameters for a specific platform.
TracingController() TracingController()
: this.fromPlatformCreationParams( : this.fromPlatformCreationParams(
const PlatformTracingControllerCreationParams(), const PlatformTracingControllerCreationParams(),
); );
/// Constructs a [TracingController] from creation params for a specific /// Constructs a [TracingController] from creation params for a specific
/// platform. /// platform.
TracingController.fromPlatformCreationParams( TracingController.fromPlatformCreationParams(
PlatformTracingControllerCreationParams params, PlatformTracingControllerCreationParams params,
) : this.fromPlatform(PlatformTracingController(params)); ) : this.fromPlatform(PlatformTracingController(params));
/// Constructs a [TracingController] from a specific platform /// Constructs a [TracingController] from a specific platform
/// implementation. /// implementation.
@ -51,7 +51,8 @@ class TracingController {
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.start](https://developer.android.com/reference/android/webkit/TracingController#start(android.webkit.TracingConfig))) ///- Android native WebView ([Official API - TracingController.start](https://developer.android.com/reference/android/webkit/TracingController#start(android.webkit.TracingConfig)))
Future<void> start({required TracingSettings settings}) => platform.start(settings: settings); Future<void> start({required TracingSettings settings}) =>
platform.start(settings: settings);
///Stops tracing and flushes tracing data to the specified output stream. ///Stops tracing and flushes tracing data to the specified output stream.
///The data is sent to the specified output stream in json format typically in ///The data is sent to the specified output stream in json format typically in

View File

@ -26,9 +26,6 @@ import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_pla
///- iOS ///- iOS
///- MacOS ///- MacOS
class WebAuthenticationSession { class WebAuthenticationSession {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
WebAuthenticationSession( WebAuthenticationSession(
{required WebUri url, {required WebUri url,
String? callbackURLScheme, String? callbackURLScheme,

View File

@ -12,7 +12,7 @@
"watch": "flutter pub run build_runner watch --delete-conflicting-outputs", "watch": "flutter pub run build_runner watch --delete-conflicting-outputs",
"publish:dry": "flutter pub publish --dry-run", "publish:dry": "flutter pub publish --dry-run",
"publish": "flutter pub publish", "publish": "flutter pub publish",
"format": "dart format lib example/integration_test", "format": "dart format lib example/integration_test flutter_inappwebview_platform_interface/lib flutter_inappwebview_android/lib",
"build:publish": "npm run format && npm run build && flutter pub publish", "build:publish": "npm run format && npm run build && flutter pub publish",
"docs:gen": "flutter pub global activate dartdoc && flutter pub global run dartdoc:dartdoc", "docs:gen": "flutter pub global activate dartdoc && flutter pub global run dartdoc:dartdoc",
"docs:serve": "flutter pub global activate dhttpd && flutter pub global run dhttpd:dhttpd --path doc/api" "docs:serve": "flutter pub global activate dhttpd && flutter pub global run dhttpd:dhttpd --path doc/api"