updated debugLoggingSettings references, dart format
This commit is contained in:
parent
9cb8b3af26
commit
0b0869ce2a
|
@ -16,14 +16,13 @@ void setGetDelete() {
|
|||
final Completer<String> pageLoaded = Completer<String>();
|
||||
|
||||
var headlessWebView = new HeadlessInAppWebView(
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete(url!.toString());
|
||||
}
|
||||
);
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete(url!.toString());
|
||||
});
|
||||
|
||||
if (defaultTargetPlatform == TargetPlatform.macOS) {
|
||||
await headlessWebView.run();
|
||||
|
|
|
@ -14,14 +14,13 @@ void convertToInAppWebView() {
|
|||
final Completer<void> pageLoaded = Completer<void>();
|
||||
|
||||
var headlessWebView = new HeadlessInAppWebView(
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete();
|
||||
}
|
||||
);
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete();
|
||||
});
|
||||
|
||||
await headlessWebView.run();
|
||||
expect(headlessWebView.isRunning(), true);
|
||||
|
|
|
@ -15,14 +15,13 @@ void runAndDispose() {
|
|||
final Completer<void> pageLoaded = Completer<void>();
|
||||
|
||||
var headlessWebView = new HeadlessInAppWebView(
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete();
|
||||
}
|
||||
);
|
||||
initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1),
|
||||
onWebViewCreated: (controller) {
|
||||
controllerCompleter.complete(controller);
|
||||
},
|
||||
onLoadStop: (controller, url) async {
|
||||
pageLoaded.complete();
|
||||
});
|
||||
|
||||
await headlessWebView.run();
|
||||
expect(headlessWebView.isRunning(), true);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
library flutter_inappwebview_android;
|
||||
|
||||
export 'src/main.dart';
|
||||
export 'src/main.dart';
|
||||
|
|
|
@ -36,24 +36,22 @@ 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();
|
||||
|
||||
/// Constructs a [AndroidChromeSafariBrowser].
|
||||
AndroidChromeSafariBrowser(PlatformChromeSafariBrowserCreationParams params)
|
||||
: super.implementation(
|
||||
params is AndroidChromeSafariBrowserCreationParams
|
||||
? params
|
||||
: AndroidChromeSafariBrowserCreationParams
|
||||
.fromPlatformChromeSafariBrowserCreationParams(params),
|
||||
);
|
||||
params is AndroidChromeSafariBrowserCreationParams
|
||||
? params
|
||||
: AndroidChromeSafariBrowserCreationParams
|
||||
.fromPlatformChromeSafariBrowserCreationParams(params),
|
||||
);
|
||||
|
||||
static final AndroidChromeSafariBrowser _staticValue =
|
||||
AndroidChromeSafariBrowser(AndroidChromeSafariBrowserCreationParams());
|
||||
AndroidChromeSafariBrowser(AndroidChromeSafariBrowserCreationParams());
|
||||
|
||||
factory AndroidChromeSafariBrowser.static() {
|
||||
return _staticValue;
|
||||
|
@ -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();
|
||||
|
|
|
@ -189,13 +189,12 @@ class AndroidCookieManager extends PlatformCookieManager
|
|||
final setCookieCompleter = Completer<void>();
|
||||
final headlessWebView =
|
||||
AndroidHeadlessInAppWebView(AndroidHeadlessInAppWebViewCreationParams(
|
||||
initialUrlRequest: URLRequest(url: url),
|
||||
onLoadStop: (controller, url) async {
|
||||
await controller.evaluateJavascript(
|
||||
source: 'document.cookie="$cookieValue"');
|
||||
setCookieCompleter.complete();
|
||||
}
|
||||
));
|
||||
initialUrlRequest: URLRequest(url: url),
|
||||
onLoadStop: (controller, url) async {
|
||||
await controller.evaluateJavascript(
|
||||
source: 'document.cookie="$cookieValue"');
|
||||
setCookieCompleter.complete();
|
||||
}));
|
||||
await headlessWebView.run();
|
||||
await setCookieCompleter.future;
|
||||
await headlessWebView.dispose();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export 'find_interaction_controller.dart' hide InternalFindInteractionController;
|
||||
export 'find_interaction_controller.dart'
|
||||
hide InternalFindInteractionController;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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!);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ 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;
|
||||
export 'process_global_config.dart' hide InternalProcessGlobalConfig;
|
||||
export 'process_global_config.dart' hide InternalProcessGlobalConfig;
|
||||
|
|
|
@ -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._();
|
||||
|
||||
|
|
|
@ -125,4 +125,3 @@ class AndroidPrintJobController extends PlatformPrintJobController
|
|||
disposeChannel();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ class AndroidProcessGlobalConfigCreationParams
|
|||
extends PlatformProcessGlobalConfigCreationParams {
|
||||
/// Creates a new [AndroidProcessGlobalConfigCreationParams] instance.
|
||||
const AndroidProcessGlobalConfigCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformProcessGlobalConfigCreationParams params,
|
||||
) : super();
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformProcessGlobalConfigCreationParams params,
|
||||
) : super();
|
||||
|
||||
/// Creates a [AndroidProcessGlobalConfigCreationParams] instance based on [PlatformProcessGlobalConfigCreationParams].
|
||||
factory AndroidProcessGlobalConfigCreationParams.fromPlatformProcessGlobalConfigCreationParams(
|
||||
|
@ -47,15 +47,16 @@ 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(
|
||||
params is AndroidProcessGlobalConfigCreationParams
|
||||
? params
|
||||
: AndroidProcessGlobalConfigCreationParams
|
||||
.fromPlatformProcessGlobalConfigCreationParams(params),
|
||||
) {
|
||||
params is AndroidProcessGlobalConfigCreationParams
|
||||
? params
|
||||
: AndroidProcessGlobalConfigCreationParams
|
||||
.fromPlatformProcessGlobalConfigCreationParams(params),
|
||||
) {
|
||||
channel = const MethodChannel(
|
||||
'com.pichillilorenzo/flutter_inappwebview_processglobalconfig');
|
||||
handler = handleMethod;
|
||||
|
@ -70,8 +71,9 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
|
|||
}
|
||||
|
||||
static AndroidProcessGlobalConfig _init() {
|
||||
_instance = AndroidProcessGlobalConfig(AndroidProcessGlobalConfigCreationParams(
|
||||
const PlatformProcessGlobalConfigCreationParams()));
|
||||
_instance = AndroidProcessGlobalConfig(
|
||||
AndroidProcessGlobalConfigCreationParams(
|
||||
const PlatformProcessGlobalConfigCreationParams()));
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
|
@ -99,4 +101,3 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig with Channe
|
|||
extension InternalProcessGlobalConfig on AndroidProcessGlobalConfig {
|
||||
get handleMethod => _handleMethod;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ class AndroidProxyControllerCreationParams
|
|||
extends PlatformProxyControllerCreationParams {
|
||||
/// Creates a new [AndroidProxyControllerCreationParams] instance.
|
||||
const AndroidProxyControllerCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformProxyControllerCreationParams params,
|
||||
) : super();
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformProxyControllerCreationParams params,
|
||||
) : super();
|
||||
|
||||
/// Creates a [AndroidProxyControllerCreationParams] instance based on [PlatformProxyControllerCreationParams].
|
||||
factory AndroidProxyControllerCreationParams.fromPlatformProxyControllerCreationParams(
|
||||
|
@ -35,15 +35,16 @@ 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(
|
||||
params is AndroidProxyControllerCreationParams
|
||||
? params
|
||||
: AndroidProxyControllerCreationParams
|
||||
.fromPlatformProxyControllerCreationParams(params),
|
||||
) {
|
||||
params is AndroidProxyControllerCreationParams
|
||||
? params
|
||||
: AndroidProxyControllerCreationParams
|
||||
.fromPlatformProxyControllerCreationParams(params),
|
||||
) {
|
||||
channel = const MethodChannel(
|
||||
'com.pichillilorenzo/flutter_inappwebview_proxycontroller');
|
||||
handler = handleMethod;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -13,10 +13,10 @@ class AndroidTracingControllerCreationParams
|
|||
extends PlatformTracingControllerCreationParams {
|
||||
/// Creates a new [AndroidTracingControllerCreationParams] instance.
|
||||
const AndroidTracingControllerCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformTracingControllerCreationParams params,
|
||||
) : super();
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformTracingControllerCreationParams params,
|
||||
) : super();
|
||||
|
||||
/// Creates a [AndroidTracingControllerCreationParams] instance based on [PlatformTracingControllerCreationParams].
|
||||
factory AndroidTracingControllerCreationParams.fromPlatformTracingControllerCreationParams(
|
||||
|
@ -34,15 +34,16 @@ 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(
|
||||
params is AndroidTracingControllerCreationParams
|
||||
? params
|
||||
: AndroidTracingControllerCreationParams
|
||||
.fromPlatformTracingControllerCreationParams(params),
|
||||
) {
|
||||
params is AndroidTracingControllerCreationParams
|
||||
? params
|
||||
: AndroidTracingControllerCreationParams
|
||||
.fromPlatformTracingControllerCreationParams(params),
|
||||
) {
|
||||
channel = const MethodChannel(
|
||||
'com.pichillilorenzo/flutter_inappwebview_tracingcontroller');
|
||||
handler = handleMethod;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,19 +47,17 @@ 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
|
||||
: AndroidWebMessagePortCreationParams
|
||||
.fromPlatformWebMessagePortCreationParams(params),
|
||||
);
|
||||
params is AndroidWebMessagePortCreationParams
|
||||
? params
|
||||
: AndroidWebMessagePortCreationParams
|
||||
.fromPlatformWebMessagePortCreationParams(params),
|
||||
);
|
||||
|
||||
///Sets a callback to receive message events on the main thread.
|
||||
Future<void> setWebMessageCallback(WebMessageCallback? onMessage) async {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
@ -90,10 +89,10 @@ class AndroidAssetsPathHandlerCreationParams
|
|||
extends PlatformAssetsPathHandlerCreationParams {
|
||||
/// Creates a new [AndroidAssetsPathHandlerCreationParams] instance.
|
||||
AndroidAssetsPathHandlerCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformAssetsPathHandlerCreationParams params,
|
||||
) : super(params);
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformAssetsPathHandlerCreationParams params,
|
||||
) : super(params);
|
||||
|
||||
/// Creates a [AndroidAssetsPathHandlerCreationParams] instance based on [PlatformAssetsPathHandlerCreationParams].
|
||||
factory AndroidAssetsPathHandlerCreationParams.fromPlatformAssetsPathHandlerCreationParams(
|
||||
|
@ -115,15 +114,16 @@ 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(
|
||||
params is AndroidAssetsPathHandlerCreationParams
|
||||
? params
|
||||
: AndroidAssetsPathHandlerCreationParams
|
||||
.fromPlatformAssetsPathHandlerCreationParams(params),
|
||||
);
|
||||
params is AndroidAssetsPathHandlerCreationParams
|
||||
? params
|
||||
: AndroidAssetsPathHandlerCreationParams
|
||||
.fromPlatformAssetsPathHandlerCreationParams(params),
|
||||
);
|
||||
}
|
||||
|
||||
/// Object specifying creation parameters for creating a [AndroidResourcesPathHandler].
|
||||
|
@ -136,10 +136,10 @@ class AndroidResourcesPathHandlerCreationParams
|
|||
extends PlatformResourcesPathHandlerCreationParams {
|
||||
/// Creates a new [AndroidResourcesPathHandlerCreationParams] instance.
|
||||
AndroidResourcesPathHandlerCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformResourcesPathHandlerCreationParams params,
|
||||
) : super(params);
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformResourcesPathHandlerCreationParams params,
|
||||
) : super(params);
|
||||
|
||||
/// Creates a [AndroidResourcesPathHandlerCreationParams] instance based on [PlatformResourcesPathHandlerCreationParams].
|
||||
factory AndroidResourcesPathHandlerCreationParams.fromPlatformResourcesPathHandlerCreationParams(
|
||||
|
@ -161,15 +161,16 @@ 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(
|
||||
params is AndroidResourcesPathHandlerCreationParams
|
||||
? params
|
||||
: AndroidResourcesPathHandlerCreationParams
|
||||
.fromPlatformResourcesPathHandlerCreationParams(params),
|
||||
);
|
||||
params is AndroidResourcesPathHandlerCreationParams
|
||||
? params
|
||||
: AndroidResourcesPathHandlerCreationParams
|
||||
.fromPlatformResourcesPathHandlerCreationParams(params),
|
||||
);
|
||||
}
|
||||
|
||||
/// Object specifying creation parameters for creating a [AndroidInternalStoragePathHandler].
|
||||
|
@ -182,10 +183,10 @@ class AndroidInternalStoragePathHandlerCreationParams
|
|||
extends PlatformInternalStoragePathHandlerCreationParams {
|
||||
/// Creates a new [AndroidInternalStoragePathHandlerCreationParams] instance.
|
||||
AndroidInternalStoragePathHandlerCreationParams(
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformInternalStoragePathHandlerCreationParams params,
|
||||
) : super(params, directory: params.directory);
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformInternalStoragePathHandlerCreationParams params,
|
||||
) : super(params, directory: params.directory);
|
||||
|
||||
/// Creates a [AndroidInternalStoragePathHandlerCreationParams] instance based on [PlatformInternalStoragePathHandlerCreationParams].
|
||||
factory AndroidInternalStoragePathHandlerCreationParams.fromPlatformInternalStoragePathHandlerCreationParams(
|
||||
|
@ -212,15 +213,17 @@ 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
|
||||
: AndroidInternalStoragePathHandlerCreationParams
|
||||
.fromPlatformInternalStoragePathHandlerCreationParams(params),
|
||||
);
|
||||
params is AndroidInternalStoragePathHandlerCreationParams
|
||||
? params
|
||||
: AndroidInternalStoragePathHandlerCreationParams
|
||||
.fromPlatformInternalStoragePathHandlerCreationParams(params),
|
||||
);
|
||||
|
||||
AndroidInternalStoragePathHandlerCreationParams get _internalParams =>
|
||||
params as AndroidInternalStoragePathHandlerCreationParams;
|
||||
|
@ -230,9 +233,6 @@ class AndroidInternalStoragePathHandler extends AndroidPathHandler implements Pl
|
|||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
...toMap(),
|
||||
'directory': directory
|
||||
};
|
||||
return {...toMap(), 'directory': directory};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
library flutter_inappwebview_platform_interface;
|
||||
|
||||
export 'src/main.dart';
|
||||
export 'src/main.dart';
|
||||
|
|
|
@ -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,21 +36,22 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`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;
|
||||
}
|
||||
|
@ -57,14 +59,15 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
|
|||
/// Creates a new [PlatformChromeSafariBrowser] to access static methods.
|
||||
factory PlatformChromeSafariBrowser.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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,16 +104,16 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface implements
|
|||
///**Supported Platforms/Implementations**:
|
||||
///- Android
|
||||
///- iOS
|
||||
Future<void> open({WebUri? url,
|
||||
Map<String, String>? headers,
|
||||
List<WebUri>? otherLikelyURLs,
|
||||
WebUri? referrer,
|
||||
@Deprecated('Use settings instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
ChromeSafariBrowserClassOptions? options,
|
||||
ChromeSafariBrowserSettings? settings}) {
|
||||
throw UnimplementedError(
|
||||
'open is not implemented on the current platform');
|
||||
Future<void> open(
|
||||
{WebUri? url,
|
||||
Map<String, String>? headers,
|
||||
List<WebUri>? otherLikelyURLs,
|
||||
WebUri? referrer,
|
||||
@Deprecated('Use settings instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
ChromeSafariBrowserClassOptions? options,
|
||||
ChromeSafariBrowserSettings? settings}) {
|
||||
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');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
@ -36,14 +37,15 @@ abstract class PlatformFindInteractionController extends PlatformInterface imple
|
|||
factory PlatformFindInteractionController(
|
||||
PlatformFindInteractionControllerCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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.
|
||||
///
|
||||
|
|
|
@ -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].
|
||||
|
@ -980,7 +984,7 @@ abstract class PlatformInAppBrowserEvents {
|
|||
///Use [onGeolocationPermissionsShowPrompt] instead.
|
||||
@Deprecated("Use onGeolocationPermissionsShowPrompt instead")
|
||||
Future<GeolocationPermissionShowPromptResponse?>?
|
||||
androidOnGeolocationPermissionsShowPrompt(String origin) {
|
||||
androidOnGeolocationPermissionsShowPrompt(String origin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -993,7 +997,7 @@ abstract class PlatformInAppBrowserEvents {
|
|||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)))
|
||||
Future<GeolocationPermissionShowPromptResponse?>?
|
||||
onGeolocationPermissionsShowPrompt(String origin) {
|
||||
onGeolocationPermissionsShowPrompt(String origin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1281,9 +1285,9 @@ abstract class PlatformInAppBrowserEvents {
|
|||
///- iOS
|
||||
///- MacOS
|
||||
void onCameraCaptureStateChanged(
|
||||
MediaCaptureState? oldState,
|
||||
MediaCaptureState? newState,
|
||||
) {}
|
||||
MediaCaptureState? oldState,
|
||||
MediaCaptureState? newState,
|
||||
) {}
|
||||
|
||||
///Event fired when a change in the microphone capture state occurred.
|
||||
///Event fired when a change in the microphone capture state occurred.
|
||||
|
@ -1296,9 +1300,9 @@ abstract class PlatformInAppBrowserEvents {
|
|||
///- iOS
|
||||
///- MacOS
|
||||
void onMicrophoneCaptureStateChanged(
|
||||
MediaCaptureState? oldState,
|
||||
MediaCaptureState? newState,
|
||||
) {}
|
||||
MediaCaptureState? oldState,
|
||||
MediaCaptureState? newState,
|
||||
) {}
|
||||
|
||||
///Event fired when the content size of the `WebView` changes.
|
||||
///
|
||||
|
@ -1309,4 +1313,4 @@ abstract class PlatformInAppBrowserEvents {
|
|||
///**Supported Platforms/Implementations**:
|
||||
///- iOS
|
||||
void onContentSizeChanged(Size oldContentSize, Size newContentSize) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
@ -78,14 +79,15 @@ abstract class PlatformInAppWebViewController extends PlatformInterface implemen
|
|||
/// Creates a new [PlatformInAppWebViewController] to access static methods.
|
||||
factory PlatformInAppWebViewController.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
@ -1181,7 +1138,7 @@ class PlatformWebViewCreationParams<T> {
|
|||
///{@macro flutter_inappwebview.WebView}
|
||||
const PlatformWebViewCreationParams(
|
||||
{this.controllerFromPlatform,
|
||||
this.windowId,
|
||||
this.windowId,
|
||||
this.onWebViewCreated,
|
||||
this.onLoadStart,
|
||||
this.onLoadStop,
|
||||
|
|
|
@ -427,8 +427,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface {
|
|||
/// This function should only be called by the app-facing package.
|
||||
/// Look at using [ChromeSafariBrowser] in `flutter_inappwebview` instead.
|
||||
PlatformChromeSafariBrowser createPlatformChromeSafariBrowser(
|
||||
PlatformChromeSafariBrowserCreationParams params,
|
||||
) {
|
||||
PlatformChromeSafariBrowserCreationParams params,
|
||||
) {
|
||||
throw UnimplementedError(
|
||||
'createPlatformChromeSafariBrowser is not implemented on the current platform.');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -27,16 +27,18 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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');
|
||||
}
|
||||
|
|
|
@ -41,16 +41,18 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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;
|
||||
}
|
||||
|
|
|
@ -42,16 +42,18 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`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;
|
||||
}
|
||||
|
|
|
@ -30,16 +30,17 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformProxyController proxyController =
|
||||
InAppWebViewPlatform.instance!.createPlatformProxyController(params);
|
||||
InAppWebViewPlatform.instance!.createPlatformProxyController(params);
|
||||
PlatformInterface.verify(proxyController, _token);
|
||||
return proxyController;
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
|
|
@ -22,16 +22,18 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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;
|
||||
}
|
||||
|
@ -39,14 +41,15 @@ abstract class PlatformServiceWorkerController extends PlatformInterface {
|
|||
/// Creates a new [PlatformServiceWorkerController]
|
||||
factory PlatformServiceWorkerController.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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});
|
||||
}
|
||||
|
||||
|
|
|
@ -29,16 +29,17 @@ 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 '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformTracingController tracingController =
|
||||
InAppWebViewPlatform.instance!.createPlatformTracingController(params);
|
||||
InAppWebViewPlatform.instance!.createPlatformTracingController(params);
|
||||
PlatformInterface.verify(tracingController, _token);
|
||||
return tracingController;
|
||||
}
|
||||
|
@ -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.
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -24,14 +24,14 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
|
|||
/// Creates a new [PlatformWebViewFeature]
|
||||
factory PlatformWebViewFeature(PlatformWebViewFeatureCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformWebViewFeature webViewFeature =
|
||||
InAppWebViewPlatform.instance!.createPlatformWebViewFeature(params);
|
||||
InAppWebViewPlatform.instance!.createPlatformWebViewFeature(params);
|
||||
PlatformInterface.verify(webViewFeature, _token);
|
||||
return webViewFeature;
|
||||
}
|
||||
|
@ -39,14 +39,14 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
|
|||
/// Creates a new empty [PlatformWebViewFeature] to access static methods.
|
||||
factory PlatformWebViewFeature.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`WebViewPlatform.instance` before use. For unit testing, '
|
||||
'`WebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformWebViewFeature webViewFeatureStatic =
|
||||
InAppWebViewPlatform.instance!.createPlatformWebViewFeatureStatic();
|
||||
InAppWebViewPlatform.instance!.createPlatformWebViewFeatureStatic();
|
||||
PlatformInterface.verify(webViewFeatureStatic, _token);
|
||||
return webViewFeatureStatic;
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -121,216 +119,216 @@ class WebViewFeature_ {
|
|||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.createWebMessageChannel].
|
||||
static const CREATE_WEB_MESSAGE_CHANNEL =
|
||||
const WebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
|
||||
const WebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.disabledActionModeMenuItems].
|
||||
static const DISABLED_ACTION_MODE_MENU_ITEMS =
|
||||
const WebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
|
||||
const WebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDark].
|
||||
static const FORCE_DARK = const WebViewFeature_._internal("FORCE_DARK");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.forceDarkStrategy].
|
||||
static const FORCE_DARK_STRATEGY =
|
||||
const WebViewFeature_._internal("FORCE_DARK_STRATEGY");
|
||||
const WebViewFeature_._internal("FORCE_DARK_STRATEGY");
|
||||
|
||||
///
|
||||
static const GET_WEB_CHROME_CLIENT =
|
||||
const WebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
|
||||
const WebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_CLIENT =
|
||||
const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
|
||||
const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_RENDERER =
|
||||
const WebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
|
||||
const WebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
|
||||
|
||||
///
|
||||
static const MULTI_PROCESS = const WebViewFeature_._internal("MULTI_PROCESS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.offscreenPreRaster].
|
||||
static const OFF_SCREEN_PRERASTER =
|
||||
const WebViewFeature_._internal("OFF_SCREEN_PRERASTER");
|
||||
const WebViewFeature_._internal("OFF_SCREEN_PRERASTER");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.postWebMessage].
|
||||
static const POST_WEB_MESSAGE =
|
||||
const WebViewFeature_._internal("POST_WEB_MESSAGE");
|
||||
const WebViewFeature_._internal("POST_WEB_MESSAGE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride].
|
||||
static const PROXY_OVERRIDE =
|
||||
const WebViewFeature_._internal("PROXY_OVERRIDE");
|
||||
const WebViewFeature_._internal("PROXY_OVERRIDE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ProxySettings.reverseBypassEnabled].
|
||||
static const PROXY_OVERRIDE_REVERSE_BYPASS =
|
||||
const WebViewFeature_._internal("PROXY_OVERRIDE_REVERSE_BYPASS");
|
||||
const WebViewFeature_._internal("PROXY_OVERRIDE_REVERSE_BYPASS");
|
||||
|
||||
///
|
||||
static const RECEIVE_HTTP_ERROR =
|
||||
const WebViewFeature_._internal("RECEIVE_HTTP_ERROR");
|
||||
const WebViewFeature_._internal("RECEIVE_HTTP_ERROR");
|
||||
|
||||
///
|
||||
static const RECEIVE_WEB_RESOURCE_ERROR =
|
||||
const WebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
const WebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
|
||||
static const SAFE_BROWSING_ALLOWLIST =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.safeBrowsingEnabled].
|
||||
static const SAFE_BROWSING_ENABLE =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_ENABLE");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_ENABLE");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_HIT =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_HIT");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_HIT");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl].
|
||||
static const SAFE_BROWSING_PRIVACY_POLICY_URL =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_PROCEED =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
|
||||
const WebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
const WebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
|
||||
///Use [SAFE_BROWSING_ALLOWLIST] instead.
|
||||
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
|
||||
static const SAFE_BROWSING_WHITELIST =
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
|
||||
const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController].
|
||||
static const SERVICE_WORKER_BASIC_USAGE =
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads].
|
||||
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode].
|
||||
static const SERVICE_WORKER_CACHE_MODE =
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess].
|
||||
static const SERVICE_WORKER_CONTENT_ACCESS =
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess].
|
||||
static const SERVICE_WORKER_FILE_ACCESS =
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
const WebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [ServiceWorkerClient.shouldInterceptRequest].
|
||||
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
|
||||
const WebViewFeature_._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
const WebViewFeature_._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
|
||||
///
|
||||
static const SHOULD_OVERRIDE_WITH_REDIRECTS =
|
||||
const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.startSafeBrowsing].
|
||||
static const START_SAFE_BROWSING =
|
||||
const WebViewFeature_._internal("START_SAFE_BROWSING");
|
||||
const WebViewFeature_._internal("START_SAFE_BROWSING");
|
||||
|
||||
///
|
||||
static const TRACING_CONTROLLER_BASIC_USAGE =
|
||||
const WebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
const WebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const VISUAL_STATE_CALLBACK =
|
||||
const WebViewFeature_._internal("VISUAL_STATE_CALLBACK");
|
||||
const WebViewFeature_._internal("VISUAL_STATE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [WebMessageListener].
|
||||
static const WEB_MESSAGE_LISTENER =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_LISTENER");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_LISTENER");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_CLOSE =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_POST_MESSAGE =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_CODE =
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
|
||||
const WebViewFeature_._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
const WebViewFeature_._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_TERMINATE =
|
||||
const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
||||
static const DOCUMENT_START_SCRIPT =
|
||||
const WebViewFeature_._internal("DOCUMENT_START_SCRIPT");
|
||||
const WebViewFeature_._internal("DOCUMENT_START_SCRIPT");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
||||
static const SUPPRESS_ERROR_PAGE =
|
||||
const WebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
|
||||
const WebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
||||
static const ALGORITHMIC_DARKENING =
|
||||
const WebViewFeature_._internal("ALGORITHMIC_DARKENING");
|
||||
const WebViewFeature_._internal("ALGORITHMIC_DARKENING");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
||||
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
||||
const WebViewFeature_._internal(
|
||||
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
|
||||
const WebViewFeature_._internal(
|
||||
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewController.getVariationsHeader].
|
||||
static const GET_VARIATIONS_HEADER =
|
||||
const WebViewFeature_._internal("GET_VARIATIONS_HEADER");
|
||||
const WebViewFeature_._internal("GET_VARIATIONS_HEADER");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods.
|
||||
static const GET_COOKIE_INFO =
|
||||
const WebViewFeature_._internal("GET_COOKIE_INFO");
|
||||
const WebViewFeature_._internal("GET_COOKIE_INFO");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers cookie attributes of [CookieManager.getCookie] and [CookieManager.getCookies] methods.
|
||||
static const REQUESTED_WITH_HEADER_ALLOW_LIST =
|
||||
const WebViewFeature_._internal("REQUESTED_WITH_HEADER_ALLOW_LIST");
|
||||
const WebViewFeature_._internal("REQUESTED_WITH_HEADER_ALLOW_LIST");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [WebMessagePort.postMessage] with `ArrayBuffer` type,
|
||||
///[InAppWebViewController.postWebMessage] with `ArrayBuffer` type, and [JavaScriptReplyProxy.postMessage] with `ArrayBuffer` type.
|
||||
static const WEB_MESSAGE_ARRAY_BUFFER =
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_ARRAY_BUFFER");
|
||||
const WebViewFeature_._internal("WEB_MESSAGE_ARRAY_BUFFER");
|
||||
|
||||
///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.dataDirectorySuffix].
|
||||
static const STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX =
|
||||
const WebViewFeature_._internal(
|
||||
"STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX");
|
||||
const WebViewFeature_._internal(
|
||||
"STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX");
|
||||
|
||||
///Feature for [isStartupFeatureSupported]. This feature covers [ProcessGlobalConfigSettings.directoryBasePaths].
|
||||
static const STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS =
|
||||
const WebViewFeature_._internal(
|
||||
"STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS");
|
||||
const WebViewFeature_._internal(
|
||||
"STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS");
|
||||
|
||||
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
|
||||
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
|
||||
|
@ -364,7 +362,7 @@ class WebViewFeature_ {
|
|||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
|
||||
static Future<bool> isStartupFeatureSupported(
|
||||
WebViewFeature startupFeature) =>
|
||||
WebViewFeature startupFeature) =>
|
||||
PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature);
|
||||
}
|
||||
|
||||
|
@ -383,198 +381,198 @@ class AndroidWebViewFeature_ {
|
|||
|
||||
///
|
||||
static const CREATE_WEB_MESSAGE_CHANNEL =
|
||||
const AndroidWebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
|
||||
const AndroidWebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
|
||||
|
||||
///
|
||||
static const DISABLED_ACTION_MODE_MENU_ITEMS =
|
||||
const AndroidWebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
|
||||
const AndroidWebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
|
||||
|
||||
///
|
||||
static const FORCE_DARK =
|
||||
const AndroidWebViewFeature_._internal("FORCE_DARK");
|
||||
const AndroidWebViewFeature_._internal("FORCE_DARK");
|
||||
|
||||
///
|
||||
static const FORCE_DARK_STRATEGY =
|
||||
const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY");
|
||||
const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY");
|
||||
|
||||
///
|
||||
static const GET_WEB_CHROME_CLIENT =
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_CLIENT =
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_RENDERER =
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
|
||||
const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
|
||||
|
||||
///
|
||||
static const MULTI_PROCESS =
|
||||
const AndroidWebViewFeature_._internal("MULTI_PROCESS");
|
||||
const AndroidWebViewFeature_._internal("MULTI_PROCESS");
|
||||
|
||||
///
|
||||
static const OFF_SCREEN_PRERASTER =
|
||||
const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER");
|
||||
const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER");
|
||||
|
||||
///
|
||||
static const POST_WEB_MESSAGE =
|
||||
const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE");
|
||||
const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE");
|
||||
|
||||
///
|
||||
static const PROXY_OVERRIDE =
|
||||
const AndroidWebViewFeature_._internal("PROXY_OVERRIDE");
|
||||
const AndroidWebViewFeature_._internal("PROXY_OVERRIDE");
|
||||
|
||||
///
|
||||
static const RECEIVE_HTTP_ERROR =
|
||||
const AndroidWebViewFeature_._internal("RECEIVE_HTTP_ERROR");
|
||||
const AndroidWebViewFeature_._internal("RECEIVE_HTTP_ERROR");
|
||||
|
||||
///
|
||||
static const RECEIVE_WEB_RESOURCE_ERROR =
|
||||
const AndroidWebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
const AndroidWebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_ALLOWLIST =
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_ENABLE =
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE");
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_HIT =
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT");
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_PRIVACY_POLICY_URL =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_PROCEED =
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
|
||||
///Use [SAFE_BROWSING_ALLOWLIST] instead.
|
||||
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
|
||||
static const SAFE_BROWSING_WHITELIST =
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
|
||||
const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_BASIC_USAGE =
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_CACHE_MODE =
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_CONTENT_ACCESS =
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_FILE_ACCESS =
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
const AndroidWebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
|
||||
///
|
||||
static const SHOULD_OVERRIDE_WITH_REDIRECTS =
|
||||
const AndroidWebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
const AndroidWebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
|
||||
///
|
||||
static const START_SAFE_BROWSING =
|
||||
const AndroidWebViewFeature_._internal("START_SAFE_BROWSING");
|
||||
const AndroidWebViewFeature_._internal("START_SAFE_BROWSING");
|
||||
|
||||
///
|
||||
static const TRACING_CONTROLLER_BASIC_USAGE =
|
||||
const AndroidWebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
const AndroidWebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const VISUAL_STATE_CALLBACK =
|
||||
const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK");
|
||||
const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_LISTENER =
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER");
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_CLOSE =
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_POST_MESSAGE =
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
|
||||
const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_CODE =
|
||||
const AndroidWebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
const AndroidWebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_TERMINATE =
|
||||
const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
||||
static const DOCUMENT_START_SCRIPT =
|
||||
const AndroidWebViewFeature_._internal("DOCUMENT_START_SCRIPT");
|
||||
const AndroidWebViewFeature_._internal("DOCUMENT_START_SCRIPT");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
||||
static const SUPPRESS_ERROR_PAGE =
|
||||
const AndroidWebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
|
||||
const AndroidWebViewFeature_._internal("SUPPRESS_ERROR_PAGE");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
||||
static const ALGORITHMIC_DARKENING =
|
||||
const AndroidWebViewFeature_._internal("ALGORITHMIC_DARKENING");
|
||||
const AndroidWebViewFeature_._internal("ALGORITHMIC_DARKENING");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
|
||||
static const REQUESTED_WITH_HEADER_CONTROL =
|
||||
const AndroidWebViewFeature_._internal("REQUESTED_WITH_HEADER_CONTROL");
|
||||
const AndroidWebViewFeature_._internal("REQUESTED_WITH_HEADER_CONTROL");
|
||||
|
||||
///Feature for [isFeatureSupported]. This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
||||
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
|
||||
const AndroidWebViewFeature_._internal(
|
||||
"ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY");
|
||||
|
||||
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
|
||||
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
|
||||
|
@ -584,4 +582,4 @@ class AndroidWebViewFeature_ {
|
|||
static Future<bool> isFeatureSupported(AndroidWebViewFeature feature) =>
|
||||
PlatformWebViewFeature.static().isFeatureSupported(
|
||||
WebViewFeature.fromNativeValue(feature.toNativeValue())!);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
PullToRefreshSettings? settings,
|
||||
this.onRefresh}) : this.options = options ?? PullToRefreshOptions(),
|
||||
PlatformPullToRefreshControllerCreationParams(
|
||||
{@Deprecated("Use settings instead") PullToRefreshOptions? options,
|
||||
PullToRefreshSettings? settings,
|
||||
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();
|
||||
|
||||
|
@ -48,14 +50,15 @@ abstract class PlatformPullToRefreshController extends PlatformInterface impleme
|
|||
factory PlatformPullToRefreshController(
|
||||
PlatformPullToRefreshControllerCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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();
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
|
||||
import '../web_uri.dart';
|
||||
|
||||
part 'loaded_resource.g.dart';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -225,4 +225,4 @@ export 'tracing_mode.dart' show TracingMode;
|
|||
export 'tracing_category.dart' show TracingCategory;
|
||||
export 'custom_tabs_post_message_result_type.dart'
|
||||
show CustomTabsPostMessageResultType;
|
||||
export 'disposable.dart';
|
||||
export 'disposable.dart';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
|
||||
import 'url_response.dart';
|
||||
|
||||
part 'navigation_response.g.dart';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
|
||||
|
||||
import '../web_uri.dart';
|
||||
import 'web_history.dart';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
@ -74,14 +75,15 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
|
|||
factory PlatformWebAuthenticationSession(
|
||||
PlatformWebAuthenticationSessionCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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;
|
||||
}
|
||||
|
@ -89,14 +91,15 @@ abstract class PlatformWebAuthenticationSession extends PlatformInterface implem
|
|||
/// Creates a new [PlatformWebAuthenticationSession] to access static methods.
|
||||
factory PlatformWebAuthenticationSession.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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.
|
||||
|
|
|
@ -56,14 +56,14 @@ abstract class PlatformWebMessageChannel extends PlatformInterface
|
|||
/// Creates a new [PlatformWebMessageChannel] to access static methods.
|
||||
factory PlatformWebMessageChannel.static() {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformWebMessageChannel webMessageChannelStatic =
|
||||
InAppWebViewPlatform.instance!.createPlatformWebMessageChannelStatic();
|
||||
InAppWebViewPlatform.instance!.createPlatformWebMessageChannelStatic();
|
||||
PlatformInterface.verify(webMessageChannelStatic, _token);
|
||||
return webMessageChannelStatic;
|
||||
}
|
||||
|
@ -111,4 +111,3 @@ abstract class PlatformWebMessageChannel extends PlatformInterface
|
|||
return 'PlatformWebMessageChannel{id: $id, port1: $port1, port2: $port2}';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ class PlatformWebMessageListenerCreationParams {
|
|||
/// Used by the platform implementation to create a new [PlatformWebMessageListener].
|
||||
const PlatformWebMessageListenerCreationParams(
|
||||
{required this.jsObjectName,
|
||||
this.allowedOriginRules,
|
||||
this.onPostMessage});
|
||||
this.allowedOriginRules,
|
||||
this.onPostMessage});
|
||||
|
||||
///{@macro flutter_inappwebview_platform_interface.PlatformWebMessageListener.jsObjectName}
|
||||
final String jsObjectName;
|
||||
|
@ -39,19 +39,20 @@ 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) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformWebMessageListener webMessageListener =
|
||||
InAppWebViewPlatform.instance!.createPlatformWebMessageListener(params);
|
||||
InAppWebViewPlatform.instance!.createPlatformWebMessageListener(params);
|
||||
PlatformInterface.verify(webMessageListener, _token);
|
||||
return webMessageListener;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -136,14 +138,15 @@ abstract class PlatformJavaScriptReplyProxy extends PlatformInterface {
|
|||
factory PlatformJavaScriptReplyProxy(
|
||||
PlatformJavaScriptReplyProxyCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`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();
|
||||
|
||||
|
|
|
@ -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,13 +282,14 @@ 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.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformStorageCreationParams params,
|
||||
) : super(webStorageType: WebStorageType.SESSION_STORAGE);
|
||||
// This parameter prevents breaking changes later.
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
PlatformStorageCreationParams params,
|
||||
) : super(webStorageType: WebStorageType.SESSION_STORAGE);
|
||||
|
||||
/// Creates a [AndroidCookieManagerCreationParams] instance based on [PlatformCookieManagerCreationParams].
|
||||
factory PlatformSessionStorageCreationParams.fromPlatformStorageCreationParams(
|
||||
|
@ -301,14 +304,14 @@ abstract class PlatformSessionStorage extends PlatformStorage {
|
|||
/// Creates a new [PlatformSessionStorage]
|
||||
factory PlatformSessionStorage(PlatformSessionStorageCreationParams params) {
|
||||
assert(
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
InAppWebViewPlatform.instance != null,
|
||||
'A platform implementation for `flutter_inappwebview` has not been set. Please '
|
||||
'ensure that an implementation of `InAppWebViewPlatform` has been set to '
|
||||
'`InAppWebViewPlatform.instance` before use. For unit testing, '
|
||||
'`InAppWebViewPlatform.instance` can be set with your own test implementation.',
|
||||
);
|
||||
final PlatformSessionStorage sessionStorage =
|
||||
InAppWebViewPlatform.instance!.createPlatformSessionStorage(params);
|
||||
InAppWebViewPlatform.instance!.createPlatformSessionStorage(params);
|
||||
PlatformInterface.verify(sessionStorage, _token);
|
||||
return sessionStorage;
|
||||
}
|
||||
|
@ -320,11 +323,11 @@ abstract class PlatformSessionStorage extends PlatformStorage {
|
|||
@protected
|
||||
PlatformSessionStorage.implementation(PlatformStorageCreationParams params)
|
||||
: super.implementation(
|
||||
params is PlatformSessionStorageCreationParams
|
||||
? params
|
||||
: PlatformSessionStorageCreationParams
|
||||
.fromPlatformStorageCreationParams(params),
|
||||
);
|
||||
params is PlatformSessionStorageCreationParams
|
||||
? params
|
||||
: PlatformSessionStorageCreationParams
|
||||
.fromPlatformStorageCreationParams(params),
|
||||
);
|
||||
|
||||
static final Object _token = Object();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@ export 'proxy_controller.dart';
|
|||
export 'webview_asset_loader.dart';
|
||||
export 'tracing_controller.dart';
|
||||
export 'process_global_config.dart';
|
||||
export 'in_app_localhost_server.dart';
|
||||
export 'in_app_localhost_server.dart';
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -30,14 +30,14 @@ class ProcessGlobalConfig {
|
|||
/// parameters for a specific platform.
|
||||
ProcessGlobalConfig()
|
||||
: this.fromPlatformCreationParams(
|
||||
const PlatformProcessGlobalConfigCreationParams(),
|
||||
);
|
||||
const PlatformProcessGlobalConfigCreationParams(),
|
||||
);
|
||||
|
||||
/// Constructs a [ProcessGlobalConfig] from creation params for a specific
|
||||
/// platform.
|
||||
ProcessGlobalConfig.fromPlatformCreationParams(
|
||||
PlatformProcessGlobalConfigCreationParams params,
|
||||
) : this.fromPlatform(PlatformProcessGlobalConfig(params));
|
||||
PlatformProcessGlobalConfigCreationParams params,
|
||||
) : this.fromPlatform(PlatformProcessGlobalConfig(params));
|
||||
|
||||
/// Constructs a [ProcessGlobalConfig] from a specific platform
|
||||
/// implementation.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,14 +18,14 @@ class ProxyController {
|
|||
/// parameters for a specific platform.
|
||||
ProxyController()
|
||||
: this.fromPlatformCreationParams(
|
||||
const PlatformProxyControllerCreationParams(),
|
||||
);
|
||||
const PlatformProxyControllerCreationParams(),
|
||||
);
|
||||
|
||||
/// Constructs a [ProxyController] from creation params for a specific
|
||||
/// platform.
|
||||
ProxyController.fromPlatformCreationParams(
|
||||
PlatformProxyControllerCreationParams params,
|
||||
) : this.fromPlatform(PlatformProxyController(params));
|
||||
PlatformProxyControllerCreationParams params,
|
||||
) : this.fromPlatform(PlatformProxyController(params));
|
||||
|
||||
/// Constructs a [ProxyController] from a specific platform
|
||||
/// implementation.
|
||||
|
@ -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.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue