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

@ -22,8 +22,7 @@ void setGetDelete() {
},
onLoadStop: (controller, url) async {
pageLoaded.complete(url!.toString());
}
);
});
if (defaultTargetPlatform == TargetPlatform.macOS) {
await headlessWebView.run();

View File

@ -20,8 +20,7 @@ void convertToInAppWebView() {
},
onLoadStop: (controller, url) async {
pageLoaded.complete();
}
);
});
await headlessWebView.run();
expect(headlessWebView.isRunning(), true);

View File

@ -21,8 +21,7 @@ void runAndDispose() {
},
onLoadStop: (controller, url) async {
pageLoaded.complete();
}
);
});
await headlessWebView.run();
expect(headlessWebView.isRunning(), true);

View File

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

View File

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

View File

@ -194,8 +194,7 @@ class AndroidCookieManager extends PlatformCookieManager
await controller.evaluateJavascript(
source: 'document.cookie="$cookieValue"');
setCookieCompleter.complete();
}
));
}));
await headlessWebView.run();
await setCookieCompleter.future;
await headlessWebView.dispose();

View File

@ -30,9 +30,6 @@ class AndroidFindInteractionControllerCreationParams
///- MacOS
class AndroidFindInteractionController extends PlatformFindInteractionController
with ChannelController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [AndroidFindInteractionController].
AndroidFindInteractionController(
PlatformFindInteractionControllerCreationParams params)
@ -47,7 +44,7 @@ class AndroidFindInteractionController extends PlatformFindInteractionController
debugLog(
className: this.runtimeType.toString(),
debugLoggingSettings:
AndroidFindInteractionController.debugLoggingSettings,
PlatformFindInteractionController.debugLoggingSettings,
method: method,
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
///- MacOS
class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
///View ID used internally.
final String id = IdGenerator.generate();

View File

@ -416,7 +416,8 @@ class AndroidInAppWebViewWidget extends PlatformInAppWebViewWidget {
method: "onWebViewCreated",
args: []);
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 'web_storage/main.dart';
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 'web_message/main.dart';
export 'print_job/main.dart';
export 'find_interaction/main.dart';
export 'service_worker_controller.dart';
export 'webview_feature.dart'
hide InternalWebViewFeature;
export 'webview_feature.dart' hide InternalWebViewFeature;
export 'proxy_controller.dart' hide InternalProxyController;
export 'webview_asset_loader.dart';
export 'tracing_controller.dart' hide InternalTracingController;

View File

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

View File

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

View File

@ -47,7 +47,8 @@ class AndroidProcessGlobalConfigCreationParams
///
///**Supported Platforms/Implementations**:
///- 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].
AndroidProcessGlobalConfig(PlatformProcessGlobalConfigCreationParams params)
: super.implementation(
@ -70,7 +71,8 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
}
static AndroidProcessGlobalConfig _init() {
_instance = AndroidProcessGlobalConfig(AndroidProcessGlobalConfigCreationParams(
_instance = AndroidProcessGlobalConfig(
AndroidProcessGlobalConfigCreationParams(
const PlatformProcessGlobalConfigCreationParams()));
return _instance!;
}
@ -99,4 +101,3 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
extension InternalProcessGlobalConfig on AndroidProcessGlobalConfig {
get handleMethod => _handleMethod;
}

View File

@ -35,7 +35,8 @@ class AndroidProxyControllerCreationParams
///
///**Supported Platforms/Implementations**:
///- 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].
AndroidProxyController(PlatformProxyControllerCreationParams params)
: super.implementation(

View File

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

View File

@ -114,7 +114,8 @@ class AndroidServiceWorkerController extends PlatformServiceWorkerController
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowContentAccess()
Future<bool> getAllowContentAccess() async {
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.

View File

@ -34,7 +34,8 @@ class AndroidTracingControllerCreationParams
///
///**Supported Platforms/Implementations**:
///- 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].
AndroidTracingController(PlatformTracingControllerCreationParams params)
: super.implementation(

View File

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

View File

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

View File

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

View File

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

View File

@ -27,8 +27,7 @@ class AndroidPathHandlerCreationParams
///A handler that produces responses for a registered path.
///
///Implement this interface to handle other use-cases according to your app's needs.
class AndroidPathHandler extends PlatformPathHandler
with ChannelController {
class AndroidPathHandler extends PlatformPathHandler with ChannelController {
/// Creates a new [AndroidPathHandler].
AndroidPathHandler(PlatformPathHandlerCreationParams params)
: super.implementation(
@ -115,7 +114,8 @@ class AndroidAssetsPathHandlerCreationParams
///[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.
///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].
AndroidAssetsPathHandler(PlatformAssetsPathHandlerCreationParams params)
: super(
@ -161,7 +161,8 @@ class AndroidResourcesPathHandlerCreationParams
///[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.
///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].
AndroidResourcesPathHandler(PlatformResourcesPathHandlerCreationParams params)
: super(
@ -212,9 +213,11 @@ class AndroidInternalStoragePathHandlerCreationParams
///[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.
///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].
AndroidInternalStoragePathHandler(PlatformInternalStoragePathHandlerCreationParams params)
AndroidInternalStoragePathHandler(
PlatformInternalStoragePathHandlerCreationParams params)
: super(
params is AndroidInternalStoragePathHandlerCreationParams
? params
@ -230,9 +233,6 @@ class AndroidInternalStoragePathHandler extends AndroidPathHandler implements Pl
@override
Map<String, dynamic> toMap() {
return {
...toMap(),
'directory': directory
};
return {...toMap(), 'directory': directory};
}
}

View File

@ -24,7 +24,8 @@ class PlatformChromeSafariBrowserCreationParams {
///**Supported Platforms/Implementations**:
///- Android
///- iOS
abstract class PlatformChromeSafariBrowser extends PlatformInterface implements Disposable {
abstract class PlatformChromeSafariBrowser extends PlatformInterface
implements Disposable {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -35,12 +36,12 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///View ID used internally.
///@{endtemplate}
String get id {
throw UnimplementedError(
'id is not implemented on the current platform');
throw UnimplementedError('id is not implemented on the current platform');
}
/// Creates a new [PlatformChromeSafariBrowser]
factory PlatformChromeSafariBrowser(PlatformChromeSafariBrowserCreationParams params) {
factory PlatformChromeSafariBrowser(
PlatformChromeSafariBrowserCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -48,8 +49,9 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
'`InAppWebViewPlatform.instance` before use. For unit testing, '
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformChromeSafariBrowser chromeSafariBrowser =
InAppWebViewPlatform.instance!.createPlatformChromeSafariBrowser(params);
final PlatformChromeSafariBrowser chromeSafariBrowser = InAppWebViewPlatform
.instance!
.createPlatformChromeSafariBrowser(params);
PlatformInterface.verify(chromeSafariBrowser, _token);
return chromeSafariBrowser;
}
@ -64,7 +66,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformChromeSafariBrowser chromeSafariBrowserStatic =
InAppWebViewPlatform.instance!.createPlatformChromeSafariBrowserStatic();
InAppWebViewPlatform.instance!
.createPlatformChromeSafariBrowserStatic();
PlatformInterface.verify(chromeSafariBrowserStatic, _token);
return chromeSafariBrowserStatic;
}
@ -74,7 +77,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformChromeSafariBrowser.implementation(this.params) : super(token: _token);
PlatformChromeSafariBrowser.implementation(this.params)
: super(token: _token);
static final Object _token = Object();
@ -100,7 +104,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///**Supported Platforms/Implementations**:
///- Android
///- iOS
Future<void> open({WebUri? url,
Future<void> open(
{WebUri? url,
Map<String, String>? headers,
List<WebUri>? otherLikelyURLs,
WebUri? referrer,
@ -108,8 +113,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
// ignore: deprecated_member_use_from_same_package
ChromeSafariBrowserClassOptions? options,
ChromeSafariBrowserSettings? settings}) {
throw UnimplementedError(
'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].
@ -148,8 +152,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///
///**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)))
Future<bool> mayLaunchUrl(
{WebUri? url, List<WebUri>? otherLikelyURLs}) {
Future<bool> mayLaunchUrl({WebUri? url, List<WebUri>? otherLikelyURLs}) {
throw UnimplementedError(
'mayLaunchUrl is not implemented on the current platform');
}
@ -170,8 +173,8 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///
///**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)))
Future<bool> validateRelationship({required CustomTabsRelationType relation,
required WebUri origin}) {
Future<bool> validateRelationship(
{required CustomTabsRelationType relation, required WebUri origin}) {
throw UnimplementedError(
'validateRelationship is not implemented on the current platform');
}
@ -405,8 +408,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
Future<void> invalidatePrewarmingToken(
PrewarmingToken prewarmingToken) {
Future<void> invalidatePrewarmingToken(PrewarmingToken prewarmingToken) {
throw UnimplementedError(
'invalidatePrewarmingToken is not implemented on the current platform');
}

View File

@ -28,7 +28,8 @@ class PlatformFindInteractionControllerCreationParams {
///- Android native WebView
///- iOS
///- MacOS
abstract class PlatformFindInteractionController extends PlatformInterface implements Disposable {
abstract class PlatformFindInteractionController extends PlatformInterface
implements Disposable {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -43,7 +44,8 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformFindInteractionController webViewControllerDelegate =
InAppWebViewPlatform.instance!.createPlatformFindInteractionController(params);
InAppWebViewPlatform.instance!
.createPlatformFindInteractionController(params);
PlatformInterface.verify(webViewControllerDelegate, _token);
return webViewControllerDelegate;
}
@ -53,7 +55,8 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformFindInteractionController.implementation(this.params) : super(token: _token);
PlatformFindInteractionController.implementation(this.params)
: super(token: _token);
static final Object _token = Object();
@ -77,11 +80,9 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
///- iOS
///- MacOS
///{@endtemplate}
void Function(
PlatformFindInteractionController controller,
int activeMatchOrdinal,
int numberOfMatches,
bool isDoneCounting)? get onFindResultReceived => params.onFindResultReceived;
void Function(PlatformFindInteractionController controller,
int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
get onFindResultReceived => params.onFindResultReceived;
///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
///- iOS
///- MacOS
abstract class PlatformInAppBrowser extends PlatformInterface implements Disposable {
abstract class PlatformInAppBrowser extends PlatformInterface
implements Disposable {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -81,17 +82,20 @@ abstract class PlatformInAppBrowser extends PlatformInterface implements Disposa
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.pullToRefreshController}
///Represents the pull-to-refresh feature controller.
///@{endtemplate}
PlatformPullToRefreshController? get pullToRefreshController => params.pullToRefreshController;
PlatformPullToRefreshController? get pullToRefreshController =>
params.pullToRefreshController;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.findInteractionController}
///Represents the find interaction feature controller.
///@{endtemplate}
PlatformFindInteractionController? get findInteractionController => params.findInteractionController;
PlatformFindInteractionController? get findInteractionController =>
params.findInteractionController;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.initialUserScripts}
///Initial list of user scripts to be loaded at start or end of a page loading.
///@{endtemplate}
UnmodifiableListView<UserScript>? get initialUserScripts => params.initialUserScripts;
UnmodifiableListView<UserScript>? get initialUserScripts =>
params.initialUserScripts;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.windowId}
///The window id of a [CreateWindowAction.windowId].

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]
///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].
///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(
@ -85,7 +86,8 @@ abstract class PlatformInAppWebViewController extends PlatformInterface implemen
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformInAppWebViewController inAppWebViewControllerStatic =
InAppWebViewPlatform.instance!.createPlatformInAppWebViewControllerStatic();
InAppWebViewPlatform.instance!
.createPlatformInAppWebViewControllerStatic();
PlatformInterface.verify(inAppWebViewControllerStatic, _token);
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].
///{@endtemplate}
class PlatformWebViewCreationParams<T> {
final T Function(PlatformInAppWebViewController controller)? controllerFromPlatform;
final T Function(PlatformInAppWebViewController controller)?
controllerFromPlatform;
///{@template flutter_inappwebview.WebView.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))
///- Web
///{@endtemplate}
final void Function(T controller, WebUri? url)?
onLoadStart;
final void Function(T controller, WebUri? url)? onLoadStart;
///{@template flutter_inappwebview.WebView.onLoadStop}
///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))
///- Web ([Official API - Window.onload](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event))
///{@endtemplate}
final void Function(T controller, WebUri? url)?
onLoadStop;
final void Function(T controller, WebUri? url)? onLoadStop;
///Use [onReceivedError] instead.
@Deprecated("Use onReceivedError instead")
final void Function(T controller, Uri? url, int code,
String message)? onLoadError;
final void Function(T controller, Uri? url, int code, String message)?
onLoadError;
///{@template flutter_inappwebview.WebView.onReceivedError}
///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))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
///{@endtemplate}
final void Function(T controller,
WebResourceRequest request, WebResourceError error)? onReceivedError;
final void Function(
T controller, WebResourceRequest request, WebResourceError error)?
onReceivedError;
///Use [onReceivedHttpError] instead.
@Deprecated("Use onReceivedHttpError instead")
final void Function(T controller, Uri? url,
int statusCode, String description)? onLoadHttpError;
final void Function(
T controller, Uri? url, int statusCode, String description)?
onLoadHttpError;
///{@template flutter_inappwebview.WebView.onReceivedHttpError}
///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))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///{@endtemplate}
final void Function(
T controller,
WebResourceRequest request,
final void Function(T controller, WebResourceRequest request,
WebResourceResponse errorResponse)? onReceivedHttpError;
///{@template flutter_inappwebview.WebView.onProgressChanged}
@ -120,8 +119,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final void Function(T controller, int progress)?
onProgressChanged;
final void Function(T controller, int progress)? onProgressChanged;
///{@template flutter_inappwebview.WebView.onConsoleMessage}
///Event fired when the `WebView` receives a [ConsoleMessage].
@ -134,8 +132,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS
///- Web
///{@endtemplate}
final void Function(
T controller, ConsoleMessage consoleMessage)?
final void Function(T controller, ConsoleMessage consoleMessage)?
onConsoleMessage;
///{@template flutter_inappwebview.WebView.shouldOverrideUrlLoading}
@ -171,9 +168,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final void Function(
T controller, LoadedResource resource)?
onLoadResource;
final void Function(T controller, LoadedResource resource)? onLoadResource;
///{@template flutter_inappwebview.WebView.onScrollChanged}
///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))
///- MacOS
///{@endtemplate}
final void Function(T controller, int x, int y)?
onScrollChanged;
final void Function(T controller, int x, int y)? onScrollChanged;
///Use [onDownloadStartRequest] instead
@Deprecated('Use onDownloadStartRequest instead')
final void Function(T controller, Uri url)?
onDownloadStart;
final void Function(T controller, Uri url)? onDownloadStart;
///{@template flutter_inappwebview.WebView.onDownloadStartRequest}
///Event fired when `WebView` recognizes a downloadable file.
@ -213,13 +206,13 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final void Function(T controller,
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
final void Function(T controller, DownloadStartRequest downloadStartRequest)?
onDownloadStartRequest;
///Use [onLoadResourceWithCustomScheme] instead.
@Deprecated('Use onLoadResourceWithCustomScheme instead')
final Future<CustomSchemeResponse?> Function(
T controller, Uri url)? onLoadResourceCustomScheme;
final Future<CustomSchemeResponse?> Function(T controller, Uri url)?
onLoadResourceCustomScheme;
///{@template flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
///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))
///{@endtemplate}
final Future<CustomSchemeResponse?> Function(
T controller, WebResourceRequest request)?
onLoadResourceWithCustomScheme;
T controller, WebResourceRequest request)? onLoadResourceWithCustomScheme;
///{@template flutter_inappwebview.WebView.onCreateWindow}
///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))
///- Web
///{@endtemplate}
final Future<bool?> Function(T controller,
CreateWindowAction createWindowAction)? onCreateWindow;
final Future<bool?> Function(
T controller, CreateWindowAction createWindowAction)? onCreateWindow;
///{@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.
@ -327,8 +319,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
///{@endtemplate}
final Future<JsAlertResponse?> Function(
T controller, JsAlertRequest jsAlertRequest)?
onJsAlert;
T controller, JsAlertRequest jsAlertRequest)? onJsAlert;
///{@template flutter_inappwebview.WebView.onJsConfirm}
///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))
///{@endtemplate}
final Future<JsConfirmResponse?> Function(
T controller, JsConfirmRequest jsConfirmRequest)?
onJsConfirm;
T controller, JsConfirmRequest jsConfirmRequest)? onJsConfirm;
///{@template flutter_inappwebview.WebView.onJsPrompt}
///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))
///{@endtemplate}
final Future<JsPromptResponse?> Function(
T controller, JsPromptRequest jsPromptRequest)?
onJsPrompt;
T controller, JsPromptRequest jsPromptRequest)? onJsPrompt;
///{@template flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
///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))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///{@endtemplate}
final Future<HttpAuthResponse?> Function(T controller,
HttpAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
final Future<HttpAuthResponse?> Function(
T controller, HttpAuthenticationChallenge challenge)?
onReceivedHttpAuthRequest;
///{@template flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
///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))
///{@endtemplate}
final Future<ClientCertResponse?> Function(
T controller, ClientCertChallenge challenge)?
onReceivedClientCertRequest;
T controller, ClientCertChallenge challenge)? onReceivedClientCertRequest;
///Use [FindInteractionController.onFindResultReceived] instead.
@Deprecated('Use FindInteractionController.onFindResultReceived instead')
final void Function(T controller, int activeMatchOrdinal,
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
final void Function(T controller, int activeMatchOrdinal, int numberOfMatches,
bool isDoneCounting)? onFindResultReceived;
///{@template flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
///Event fired when an `XMLHttpRequest` is sent to a server.
@ -427,8 +416,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final Future<AjaxRequest?> Function(
T controller, AjaxRequest ajaxRequest)?
final Future<AjaxRequest?> Function(T controller, AjaxRequest ajaxRequest)?
shouldInterceptAjaxRequest;
///{@template flutter_inappwebview.WebView.onAjaxReadyStateChange}
@ -449,8 +437,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS
///{@endtemplate}
final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)?
onAjaxReadyStateChange;
T controller, AjaxRequest ajaxRequest)? onAjaxReadyStateChange;
///{@template flutter_inappwebview.WebView.onAjaxProgress}
///Event fired as an `XMLHttpRequest` progress.
@ -470,8 +457,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS
///{@endtemplate}
final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)?
onAjaxProgress;
T controller, AjaxRequest ajaxRequest)? onAjaxProgress;
///{@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).
@ -490,8 +476,7 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final Future<FetchRequest?> Function(
T controller, FetchRequest fetchRequest)?
final Future<FetchRequest?> Function(T controller, FetchRequest fetchRequest)?
shouldInterceptFetchRequest;
///{@template flutter_inappwebview.WebView.onUpdateVisitedHistory}
@ -512,8 +497,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS
///- Web
///{@endtemplate}
final void Function(
T controller, WebUri? url, bool? isReload)?
final void Function(T controller, WebUri? url, bool? isReload)?
onUpdateVisitedHistory;
///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)))
///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer))
///{@endtemplate}
final void Function(T controller,
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
final void Function(T controller, InAppWebViewHitTestResult hitTestResult)?
onLongPressHitTestResult;
///{@template flutter_inappwebview.WebView.onEnterFullscreen}
///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))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///{@endtemplate}
final void Function(T controller, WebUri? url)?
onPageCommitVisible;
final void Function(T controller, WebUri? url)? onPageCommitVisible;
///{@template flutter_inappwebview.WebView.onTitleChanged}
///Event fired when a change in the document title occurred.
@ -608,8 +591,7 @@ class PlatformWebViewCreationParams<T> {
///- MacOS
///- Web
///{@endtemplate}
final void Function(T controller, String? title)?
onTitleChanged;
final void Function(T controller, String? title)? onTitleChanged;
///{@template flutter_inappwebview.WebView.onOverScrolled}
///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)))
///- iOS
///{@endtemplate}
final void Function(T controller, int x, int y,
bool clampedX, bool clampedY)? onOverScrolled;
final void Function(T controller, int x, int y, bool clampedX, bool clampedY)?
onOverScrolled;
///{@template flutter_inappwebview.WebView.onZoomScaleChanged}
///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))
///- Web
///{@endtemplate}
final void Function(
T controller, double oldScale, double newScale)?
final void Function(T controller, double oldScale, double newScale)?
onZoomScaleChanged;
///Use [onSafeBrowsingHit] instead.
@Deprecated("Use onSafeBrowsingHit instead")
final Future<SafeBrowsingResponse?> Function(
T controller,
Uri url,
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
T controller, Uri url, SafeBrowsingThreat? threatType)?
androidOnSafeBrowsingHit;
///{@template flutter_inappwebview.WebView.onSafeBrowsingHit}
///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)))
///{@endtemplate}
final Future<SafeBrowsingResponse?> Function(
T controller,
WebUri url,
SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
T controller, WebUri url, SafeBrowsingThreat? threatType)?
onSafeBrowsingHit;
///Use [onPermissionRequest] instead.
@Deprecated("Use onPermissionRequest instead")
final Future<PermissionRequestResponse?> Function(
T controller,
String origin,
List<String> resources)? androidOnPermissionRequest;
T controller, String origin, List<String> resources)?
androidOnPermissionRequest;
///{@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.
@ -696,14 +674,13 @@ class PlatformWebViewCreationParams<T> {
///- iOS
///- MacOS
///{@endtemplate}
final Future<PermissionResponse?> Function(T controller,
PermissionRequest permissionRequest)? onPermissionRequest;
final Future<PermissionResponse?> Function(
T controller, PermissionRequest permissionRequest)? onPermissionRequest;
///Use [onGeolocationPermissionsShowPrompt] instead.
@Deprecated("Use onGeolocationPermissionsShowPrompt instead")
final Future<GeolocationPermissionShowPromptResponse?> Function(
T controller, String origin)?
androidOnGeolocationPermissionsShowPrompt;
T controller, String origin)? androidOnGeolocationPermissionsShowPrompt;
///{@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.
@ -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)))
///{@endtemplate}
final Future<GeolocationPermissionShowPromptResponse?> Function(
T controller, String origin)?
onGeolocationPermissionsShowPrompt;
T controller, String origin)? onGeolocationPermissionsShowPrompt;
///Use [onGeolocationPermissionsHidePrompt] instead.
@Deprecated("Use onGeolocationPermissionsHidePrompt instead")
final void Function(T controller)?
androidOnGeolocationPermissionsHidePrompt;
final void Function(T controller)? androidOnGeolocationPermissionsHidePrompt;
///{@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.
@ -731,14 +706,12 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
///{@endtemplate}
final void Function(T controller)?
onGeolocationPermissionsHidePrompt;
final void Function(T controller)? onGeolocationPermissionsHidePrompt;
///Use [shouldInterceptRequest] instead.
@Deprecated("Use shouldInterceptRequest instead")
final Future<WebResourceResponse?> Function(
T controller, WebResourceRequest request)?
androidShouldInterceptRequest;
T controller, WebResourceRequest request)? androidShouldInterceptRequest;
///{@template flutter_inappwebview.WebView.shouldInterceptRequest}
///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)))
///{@endtemplate}
final Future<WebResourceResponse?> Function(
T controller, WebResourceRequest request)?
shouldInterceptRequest;
T controller, WebResourceRequest request)? shouldInterceptRequest;
///Use [onRenderProcessUnresponsive] instead.
@Deprecated("Use onRenderProcessUnresponsive instead")
final Future<WebViewRenderProcessAction?> Function(
T controller, Uri? url)?
final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
androidOnRenderProcessUnresponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessUnresponsive}
@ -789,14 +760,12 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function(
T controller, WebUri? url)?
final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
onRenderProcessUnresponsive;
///Use [onRenderProcessResponsive] instead.
@Deprecated("Use onRenderProcessResponsive instead")
final Future<WebViewRenderProcessAction?> Function(
T controller, Uri? url)?
final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
androidOnRenderProcessResponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessResponsive}
@ -813,14 +782,12 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function(
T controller, WebUri? url)?
final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
onRenderProcessResponsive;
///Use [onRenderProcessGone] instead.
@Deprecated("Use onRenderProcessGone instead")
final void Function(
T controller, RenderProcessGoneDetail detail)?
final void Function(T controller, RenderProcessGoneDetail detail)?
androidOnRenderProcessGone;
///{@template flutter_inappwebview.WebView.onRenderProcessGone}
@ -835,14 +802,13 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final void Function(
T controller, RenderProcessGoneDetail detail)?
final void Function(T controller, RenderProcessGoneDetail detail)?
onRenderProcessGone;
///Use [onFormResubmission] instead.
@Deprecated('Use onFormResubmission instead')
final Future<FormResubmissionAction?> Function(
T controller, Uri? url)? androidOnFormResubmission;
final Future<FormResubmissionAction?> Function(T controller, Uri? url)?
androidOnFormResubmission;
///{@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.
@ -850,19 +816,17 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final Future<FormResubmissionAction?> Function(
T controller, WebUri? url)? onFormResubmission;
final Future<FormResubmissionAction?> Function(T controller, WebUri? url)?
onFormResubmission;
///Use [onZoomScaleChanged] instead.
@Deprecated('Use onZoomScaleChanged instead')
final void Function(
T controller, double oldScale, double newScale)?
final void Function(T controller, double oldScale, double newScale)?
androidOnScaleChanged;
///Use [onReceivedIcon] instead.
@Deprecated('Use onReceivedIcon instead')
final void Function(T controller, Uint8List icon)?
androidOnReceivedIcon;
final void Function(T controller, Uint8List icon)? androidOnReceivedIcon;
///{@template flutter_inappwebview.WebView.onReceivedIcon}
///Event fired when there is new favicon for the current page.
@ -872,13 +836,11 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final void Function(T controller, Uint8List icon)?
onReceivedIcon;
final void Function(T controller, Uint8List icon)? onReceivedIcon;
///Use [onReceivedTouchIconUrl] instead.
@Deprecated('Use onReceivedTouchIconUrl instead')
final void Function(
T controller, Uri url, bool precomposed)?
final void Function(T controller, Uri url, bool precomposed)?
androidOnReceivedTouchIconUrl;
///{@template flutter_inappwebview.WebView.onReceivedTouchIconUrl}
@ -891,15 +853,14 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final void Function(
T controller, WebUri url, bool precomposed)?
final void Function(T controller, WebUri url, bool precomposed)?
onReceivedTouchIconUrl;
///Use [onJsBeforeUnload] instead.
@Deprecated('Use onJsBeforeUnload instead')
final Future<JsBeforeUnloadResponse?> Function(
T controller,
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload;
T controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?
androidOnJsBeforeUnload;
///{@template flutter_inappwebview.WebView.onJsBeforeUnload}
///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)))
///{@endtemplate}
final Future<JsBeforeUnloadResponse?> Function(
T controller,
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
T controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?
onJsBeforeUnload;
///Use [onReceivedLoginRequest] instead.
@Deprecated('Use onReceivedLoginRequest instead')
final void Function(
T controller, LoginRequest loginRequest)?
final void Function(T controller, LoginRequest loginRequest)?
androidOnReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onReceivedLoginRequest}
@ -933,8 +893,7 @@ class PlatformWebViewCreationParams<T> {
///**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)))
///{@endtemplate}
final void Function(
T controller, LoginRequest loginRequest)?
final void Function(T controller, LoginRequest loginRequest)?
onReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onPermissionRequestCanceled}
@ -949,8 +908,8 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
///{@endtemplate}
final void Function(T controller,
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
final void Function(T controller, PermissionRequest permissionRequest)?
onPermissionRequestCanceled;
///{@template flutter_inappwebview.WebView.onRequestFocus}
///Request display and focus for this WebView.
@ -963,8 +922,7 @@ class PlatformWebViewCreationParams<T> {
///Use [onWebContentProcessDidTerminate] instead.
@Deprecated('Use onWebContentProcessDidTerminate instead')
final void Function(T controller)?
iosOnWebContentProcessDidTerminate;
final void Function(T controller)? iosOnWebContentProcessDidTerminate;
///{@template flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
///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))
///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///{@endtemplate}
final void Function(T controller)?
onWebContentProcessDidTerminate;
final void Function(T controller)? onWebContentProcessDidTerminate;
///Use [onDidReceiveServerRedirectForProvisionalNavigation] instead.
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
@ -994,8 +951,8 @@ class PlatformWebViewCreationParams<T> {
///Use [onNavigationResponse] instead.
@Deprecated('Use onNavigationResponse instead')
final Future<IOSNavigationResponseAction?> Function(
T controller,
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
T controller, IOSWKNavigationResponse navigationResponse)?
iosOnNavigationResponse;
///{@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.
@ -1009,14 +966,14 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///{@endtemplate}
final Future<NavigationResponseAction?> Function(
T controller,
NavigationResponse navigationResponse)? onNavigationResponse;
T controller, NavigationResponse navigationResponse)?
onNavigationResponse;
///Use [shouldAllowDeprecatedTLS] instead.
@Deprecated('Use shouldAllowDeprecatedTLS instead')
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(
T controller,
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
T controller, URLAuthenticationChallenge challenge)?
iosShouldAllowDeprecatedTLS;
///{@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).
@ -1032,8 +989,8 @@ class PlatformWebViewCreationParams<T> {
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
///{@endtemplate}
final Future<ShouldAllowDeprecatedTLSAction?> Function(
T controller,
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
T controller, URLAuthenticationChallenge challenge)?
shouldAllowDeprecatedTLS;
///{@template flutter_inappwebview.WebView.onCameraCaptureStateChanged}
///Event fired when a change in the camera capture state occurred.
@ -1079,8 +1036,8 @@ class PlatformWebViewCreationParams<T> {
///**Supported Platforms/Implementations**:
///- iOS
///{@endtemplate}
final void Function(T controller, Size oldContentSize,
Size newContentSize)? onContentSizeChanged;
final void Function(T controller, Size oldContentSize, Size newContentSize)?
onContentSizeChanged;
///{@template flutter_inappwebview.WebView.initialUrlRequest}
///Initial url request that will be loaded.

View File

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

View File

@ -27,7 +27,8 @@ class PlatformHttpAuthCredentialDatabaseCreationParams {
///- MacOS
abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
/// Creates a new [PlatformHttpAuthCredentialDatabase]
factory PlatformHttpAuthCredentialDatabase(PlatformHttpAuthCredentialDatabaseCreationParams params) {
factory PlatformHttpAuthCredentialDatabase(
PlatformHttpAuthCredentialDatabaseCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -36,7 +37,8 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
'`WebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformHttpAuthCredentialDatabase cookieManager =
InAppWebViewPlatform.instance!.createPlatformHttpAuthCredentialDatabase(params);
InAppWebViewPlatform.instance!
.createPlatformHttpAuthCredentialDatabase(params);
PlatformInterface.verify(cookieManager, _token);
return cookieManager;
}
@ -63,8 +65,7 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
///- Android native WebView
///- 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))
Future<List<URLProtectionSpaceHttpAuthCredentials>>
getAllAuthCredentials() {
Future<List<URLProtectionSpaceHttpAuthCredentials>> getAllAuthCredentials() {
throw UnimplementedError(
'getAllAuthCredentials is not implemented on the current platform');
}

View File

@ -41,7 +41,8 @@ class PlatformInAppLocalhostServerCreationParams {
///- MacOS
abstract class PlatformInAppLocalhostServer extends PlatformInterface {
/// Creates a new [PlatformInAppLocalhostServer]
factory PlatformInAppLocalhostServer(PlatformInAppLocalhostServerCreationParams params) {
factory PlatformInAppLocalhostServer(
PlatformInAppLocalhostServerCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -50,7 +51,8 @@ abstract class PlatformInAppLocalhostServer extends PlatformInterface {
'`WebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformInAppLocalhostServer inAppLocalhostServer =
InAppWebViewPlatform.instance!.createPlatformInAppLocalhostServer(params);
InAppWebViewPlatform.instance!
.createPlatformInAppLocalhostServer(params);
PlatformInterface.verify(inAppLocalhostServer, _token);
return inAppLocalhostServer;
}

View File

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

View File

@ -30,7 +30,8 @@ class PlatformProxyControllerCreationParams {
///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController))
abstract class PlatformProxyController extends PlatformInterface {
/// Creates a new [PlatformProxyController]
factory PlatformProxyController(PlatformProxyControllerCreationParams params) {
factory PlatformProxyController(
PlatformProxyControllerCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -50,8 +51,7 @@ abstract class PlatformProxyController extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformProxyController.implementation(this.params)
: super(token: _token);
PlatformProxyController.implementation(this.params) : super(token: _token);
static final Object _token = Object();

View File

@ -22,7 +22,8 @@ class PlatformServiceWorkerControllerCreationParams {
///- Android native WebView ([Official API - ServiceWorkerControllerCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat))
abstract class PlatformServiceWorkerController extends PlatformInterface {
/// Creates a new [PlatformServiceWorkerController]
factory PlatformServiceWorkerController(PlatformServiceWorkerControllerCreationParams params) {
factory PlatformServiceWorkerController(
PlatformServiceWorkerControllerCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -31,7 +32,8 @@ abstract class PlatformServiceWorkerController extends PlatformInterface {
'`WebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformServiceWorkerController serviceWorkerController =
InAppWebViewPlatform.instance!.createPlatformServiceWorkerController(params);
InAppWebViewPlatform.instance!
.createPlatformServiceWorkerController(params);
PlatformInterface.verify(serviceWorkerController, _token);
return serviceWorkerController;
}
@ -46,7 +48,8 @@ abstract class PlatformServiceWorkerController extends PlatformInterface {
'`WebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformServiceWorkerController serviceWorkerControllerStatic =
InAppWebViewPlatform.instance!.createPlatformServiceWorkerControllerStatic();
InAppWebViewPlatform.instance!
.createPlatformServiceWorkerControllerStatic();
PlatformInterface.verify(serviceWorkerControllerStatic, _token);
return serviceWorkerControllerStatic;
}
@ -188,4 +191,3 @@ class ServiceWorkerClient {
ServiceWorkerClient({this.shouldInterceptRequest});
}

View File

@ -29,7 +29,8 @@ class PlatformTracingControllerCreationParams {
///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController))
abstract class PlatformTracingController extends PlatformInterface {
/// Creates a new [PlatformTracingController]
factory PlatformTracingController(PlatformTracingControllerCreationParams params) {
factory PlatformTracingController(
PlatformTracingControllerCreationParams params) {
assert(
InAppWebViewPlatform.instance != null,
'A platform implementation for `flutter_inappwebview` has not been set. Please '
@ -49,8 +50,7 @@ abstract class PlatformTracingController extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformTracingController.implementation(this.params)
: super(token: _token);
PlatformTracingController.implementation(this.params) : super(token: _token);
static final Object _token = Object();
@ -80,8 +80,7 @@ abstract class PlatformTracingController extends PlatformInterface {
///**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)))
Future<bool> stop({String? filePath}) {
throw UnimplementedError(
'stop is not implemented on the current platform');
throw UnimplementedError('stop is not implemented on the current platform');
}
///Returns whether the WebView framework is tracing.

View File

@ -43,8 +43,7 @@ class WebViewAssetLoader_ {
abstract class IPathHandler {
String get path {
throw UnimplementedError(
'path is not implemented on the current platform');
throw UnimplementedError('path is not implemented on the current platform');
}
Map<String, dynamic> toMap() {
@ -74,7 +73,8 @@ class PlatformPathHandlerCreationParams {
///A handler that produces responses for a registered path.
///
///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]
factory PlatformPathHandler(PlatformPathHandlerCreationParams params) {
assert(

View File

@ -57,8 +57,7 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformWebViewFeature.implementation(this.params)
: super(token: _token);
PlatformWebViewFeature.implementation(this.params) : super(token: _token);
static final Object _token = Object();
@ -98,8 +97,7 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
///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)
Future<bool> isStartupFeatureSupported(
WebViewFeature startupFeature) {
Future<bool> isStartupFeatureSupported(WebViewFeature startupFeature) {
throw UnimplementedError(
'isStartupFeatureSupported is not implemented on the current platform');
}

View File

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

View File

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

View File

@ -1,8 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../util.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 'console_message_level.dart';
part 'console_message.g.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'navigation_action.dart';
import 'window_features.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';
part 'custom_scheme_response.g.dart';
///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 '../web_uri.dart';
part 'download_start_request.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'force_dark_strategy.g.dart';
///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';
part 'form_resubmission_action.g.dart';
///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';
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.

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'http_auth_response_action.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 'url_credential.dart';
import 'url_response.dart';
import 'url_authentication_challenge.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.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 '../web_uri.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 'js_alert_response_action.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 '../web_uri.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 'js_before_unload_response_action.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 '../web_uri.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 'js_confirm_response_action.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 '../web_uri.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 'js_prompt_response_action.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 '../web_uri.dart';
part 'loaded_resource.g.dart';

View File

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

View File

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

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'navigation_action_policy.g.dart';
///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 'url_response.dart';
part 'navigation_response.g.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'navigation_response_action.g.dart';
///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';
part 'navigation_type.g.dart';
///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';
part 'over_scroll_mode.g.dart';
///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 'in_app_webview_rect.dart';
part 'pdf_configuration.g.dart';

View File

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

View File

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

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'renderer_priority.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 'renderer_priority.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 '../in_app_webview/platform_inappwebview_controller.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 '../in_app_webview/platform_inappwebview_controller.dart';
import 'in_app_webview_rect.dart';
import 'compress_format.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'server_trust_auth_response_action.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 'url_authentication_challenge.dart';
import 'url_protection_space.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'should_allow_deprecated_tls_action.g.dart';
///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 'user_script_injection_time.dart';
import 'content_world.dart';
import '../platform_webview_feature.dart';

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'user_script.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 'web_history_item.dart';
part 'web_history.g.dart';

View File

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

View File

@ -1,6 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.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';
part 'web_resource_response.g.dart';
///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';
part 'webview_package_info.g.dart';
///Class that represents a `WebView` package info.

View File

@ -1,7 +1,5 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'webview_render_process_action.g.dart';
///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**:
///- iOS
///- MacOS
abstract class PlatformWebAuthenticationSession extends PlatformInterface implements Disposable {
abstract class PlatformWebAuthenticationSession extends PlatformInterface
implements Disposable {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
@ -81,7 +82,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformWebAuthenticationSession webAuthenticationSession =
InAppWebViewPlatform.instance!.createPlatformWebAuthenticationSession(params);
InAppWebViewPlatform.instance!
.createPlatformWebAuthenticationSession(params);
PlatformInterface.verify(webAuthenticationSession, _token);
return webAuthenticationSession;
}
@ -96,7 +98,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformWebAuthenticationSession webAuthenticationSessionStatic =
InAppWebViewPlatform.instance!.createPlatformWebAuthenticationSessionStatic();
InAppWebViewPlatform.instance!
.createPlatformWebAuthenticationSessionStatic();
PlatformInterface.verify(webAuthenticationSessionStatic, _token);
return webAuthenticationSessionStatic;
}
@ -106,7 +109,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformWebAuthenticationSession.implementation(this.params) : super(token: _token);
PlatformWebAuthenticationSession.implementation(this.params)
: super(token: _token);
static final Object _token = Object();
@ -131,7 +135,8 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.initialSettings}
///Initial settings.
///{@endtemplate}
WebAuthenticationSessionSettings? get initialSettings => params.initialSettings;
WebAuthenticationSessionSettings? get initialSettings =>
params.initialSettings;
///{@template flutter_inappwebview_platform_interface.PlatformWebAuthenticationSession.onComplete}
///A completion handler the session calls when it completes successfully, or when the user cancels the session.

View File

@ -111,4 +111,3 @@ abstract class PlatformWebMessageChannel extends PlatformInterface
return 'PlatformWebMessageChannel{id: $id, port1: $port1, port2: $port2}';
}
}

View File

@ -39,7 +39,8 @@ class PlatformWebMessageListenerCreationParams {
///- Android native WebView
///- iOS
///- MacOS
abstract class PlatformWebMessageListener extends PlatformInterface implements Disposable {
abstract class PlatformWebMessageListener extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformWebMessageListener]
factory PlatformWebMessageListener(
PlatformWebMessageListenerCreationParams params) {
@ -121,7 +122,8 @@ abstract class PlatformWebMessageListener extends PlatformInterface implements D
@immutable
class PlatformJavaScriptReplyProxyCreationParams {
/// Used by the platform implementation to create a new [PlatformJavaScriptReplyProxy].
const PlatformJavaScriptReplyProxyCreationParams({required this.webMessageListener});
const PlatformJavaScriptReplyProxyCreationParams(
{required this.webMessageListener});
final PlatformWebMessageListener webMessageListener;
}
@ -143,7 +145,8 @@ abstract class PlatformJavaScriptReplyProxy extends PlatformInterface {
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
);
final PlatformJavaScriptReplyProxy javaScriptReplyProxy =
InAppWebViewPlatform.instance!.createPlatformJavaScriptReplyProxy(params);
InAppWebViewPlatform.instance!
.createPlatformJavaScriptReplyProxy(params);
PlatformInterface.verify(javaScriptReplyProxy, _token);
return javaScriptReplyProxy;
}
@ -153,7 +156,8 @@ abstract class PlatformJavaScriptReplyProxy extends PlatformInterface {
/// Should only be used by platform implementations because they can't extend
/// a class that only contains a factory constructor.
@protected
PlatformJavaScriptReplyProxy.implementation(this.params) : super(token: _token);
PlatformJavaScriptReplyProxy.implementation(this.params)
: super(token: _token);
static final Object _token = Object();

View File

@ -32,7 +32,8 @@ class PlatformWebStorageCreationParams {
///- iOS
///- MacOS
///- Web
abstract class PlatformWebStorage extends PlatformInterface implements Disposable {
abstract class PlatformWebStorage extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformWebStorage]
factory PlatformWebStorage(PlatformWebStorageCreationParams params) {
assert(
@ -217,7 +218,8 @@ abstract class PlatformStorage extends PlatformInterface implements Disposable {
@override
void dispose() {
throw UnimplementedError('dispose is not implemented on the current platform');
throw UnimplementedError(
'dispose is not implemented on the current platform');
}
}
@ -280,7 +282,8 @@ abstract class PlatformLocalStorage extends PlatformStorage {
/// Platform specific implementations can add additional fields by extending
/// this class.
@immutable
class PlatformSessionStorageCreationParams extends PlatformStorageCreationParams {
class PlatformSessionStorageCreationParams
extends PlatformStorageCreationParams {
/// Used by the platform implementation to create a new [PlatformSessionStorage].
const PlatformSessionStorageCreationParams(
// This parameter prevents breaking changes later.

View File

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

View File

@ -5,9 +5,6 @@ import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_pla
///- iOS
///- MacOS
class FindInteractionController {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
FindInteractionController(
{void Function(PlatformFindInteractionController controller,
int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
@ -31,11 +28,9 @@ class FindInteractionController {
final PlatformFindInteractionController platform;
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.onFindResultReceived}
void Function(
PlatformFindInteractionController controller,
int activeMatchOrdinal,
int numberOfMatches,
bool isDoneCounting)? get onFindResultReceived => platform.onFindResultReceived;
void Function(PlatformFindInteractionController controller,
int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
get onFindResultReceived => platform.onFindResultReceived;
///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
///- MacOS
class InAppBrowser implements PlatformInAppBrowserEvents {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
/// Constructs a [InAppBrowser].
///
/// See [InAppBrowser.fromPlatformCreationParams] for setting

View File

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

View File

@ -8,7 +8,6 @@ import '../in_app_webview/in_app_webview_controller.dart';
///- iOS
///- MacOS
class PrintJobController {
PrintJobController({required String id, PrintJobCompletionHandler onComplete})
: this.fromPlatformCreationParams(
params: PlatformPrintJobControllerCreationParams(
@ -57,7 +56,8 @@ class PrintJobController {
///
///**Supported Platforms/Implementations**:
///- 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.
///

View File

@ -63,6 +63,6 @@ class ProcessGlobalConfig {
///
///**Supported Platforms/Implementations**:
///- 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

@ -51,7 +51,8 @@ class ProxyController {
///
///**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)))
Future<void> setProxyOverride({required ProxySettings settings}) => platform.setProxyOverride(settings: settings);
Future<void> setProxyOverride({required ProxySettings settings}) =>
platform.setProxyOverride(settings: 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.

View File

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

View File

@ -51,7 +51,8 @@ class TracingController {
///
///**Supported Platforms/Implementations**:
///- 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.
///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
///- MacOS
class WebAuthenticationSession {
///Debug settings.
static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings();
WebAuthenticationSession(
{required WebUri url,
String? callbackURLScheme,

View File

@ -12,7 +12,7 @@
"watch": "flutter pub run build_runner watch --delete-conflicting-outputs",
"publish:dry": "flutter pub publish --dry-run",
"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",
"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"