iosWebViewFix/lib/src/in_app_webview/headless_in_app_webview.dart

686 lines
23 KiB
Dart
Raw Normal View History

import 'dart:collection';
import 'dart:typed_data';
import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/src/util.dart';
import '../context_menu.dart';
import '../types/main.dart';
import 'webview.dart';
import 'in_app_webview_controller.dart';
2022-04-19 23:31:14 +00:00
import 'in_app_webview_settings.dart';
import '../pull_to_refresh/pull_to_refresh_controller.dart';
2022-04-20 01:05:46 +00:00
import '../pull_to_refresh/pull_to_refresh_settings.dart';
import '../util.dart';
///Class that represents a WebView in headless mode.
///It can be used to run a WebView in background without attaching an `InAppWebView` to the widget tree.
///
2022-05-08 23:51:21 +00:00
///**NOTE**: Remember to dispose it when you don't need it anymore.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
class HeadlessInAppWebView implements WebView {
///View ID.
late final String id;
bool _started = false;
bool _running = false;
static const MethodChannel _sharedChannel =
const MethodChannel('com.pichillilorenzo/flutter_headless_inappwebview');
late MethodChannel _channel;
///WebView Controller that can be used to access the [InAppWebViewController] API.
late final InAppWebViewController webViewController;
///The window id of a [CreateWindowAction.windowId].
final int? windowId;
///The WebView initial size in pixels.
///
///Set `-1` to match the corresponding width or height of the current device screen size.
///`Size(-1, -1)` will match both width and height of the current device screen size.
///
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
final Size initialSize;
2022-04-20 01:05:46 +00:00
HeadlessInAppWebView({
this.initialSize = const Size(-1, -1),
this.windowId,
this.initialUrlRequest,
this.initialFile,
this.initialData,
@Deprecated('Use initialSettings instead') this.initialOptions,
this.initialSettings,
this.contextMenu,
this.initialUserScripts,
this.pullToRefreshController,
this.implementation = WebViewImplementation.NATIVE,
this.onWebViewCreated,
this.onLoadStart,
this.onLoadStop,
@Deprecated("Use onReceivedError instead") this.onLoadError,
this.onReceivedError,
@Deprecated("Use onReceivedHttpError instead") this.onLoadHttpError,
this.onReceivedHttpError,
2022-04-20 01:05:46 +00:00
this.onProgressChanged,
this.onConsoleMessage,
this.shouldOverrideUrlLoading,
this.onLoadResource,
this.onScrollChanged,
@Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead') this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme,
2022-04-20 01:05:46 +00:00
this.onCreateWindow,
this.onCloseWindow,
this.onJsAlert,
this.onJsConfirm,
this.onJsPrompt,
this.onReceivedHttpAuthRequest,
this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest,
this.onFindResultReceived,
this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange,
this.onAjaxProgress,
this.shouldInterceptFetchRequest,
this.onUpdateVisitedHistory,
this.onPrint,
this.onLongPressHitTestResult,
this.onEnterFullscreen,
this.onExitFullscreen,
this.onPageCommitVisible,
this.onTitleChanged,
this.onWindowFocus,
this.onWindowBlur,
this.onOverScrolled,
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest,
this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest,
this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone,
this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission,
this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest,
@Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse,
this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged,
2022-04-20 01:05:46 +00:00
}) {
id = IdGenerator.generate();
webViewController = new InAppWebViewController(id, this);
this._channel =
MethodChannel('com.pichillilorenzo/flutter_headless_inappwebview_$id');
this._channel.setMethodCallHandler(handleMethod);
}
Future<dynamic> handleMethod(MethodCall call) async {
switch (call.method) {
case "onWebViewCreated":
pullToRefreshController?.initMethodChannel(id);
if (onWebViewCreated != null) {
onWebViewCreated!(webViewController);
}
break;
default:
throw UnimplementedError("Unimplemented ${call.method} method");
}
return null;
}
///Runs the headless WebView.
2022-04-28 21:23:38 +00:00
///
///**NOTE for Web**: it will append a new `iframe` to the body.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
Future<void> run() async {
if (_started) {
return;
}
_started = true;
2022-04-19 23:31:14 +00:00
2022-04-20 01:05:46 +00:00
Map<String, dynamic> initialSettings = this.initialSettings?.toMap() ??
// ignore: deprecated_member_use_from_same_package
this.initialOptions?.toMap() ??
{};
Map<String, dynamic> pullToRefreshSettings =
this.pullToRefreshController?.settings.toMap() ??
// ignore: deprecated_member_use_from_same_package
this.pullToRefreshController?.options.toMap() ??
PullToRefreshSettings(enabled: false).toMap();
2022-04-19 23:31:14 +00:00
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('id', () => id);
args.putIfAbsent(
'params',
() => <String, dynamic>{
'initialUrlRequest': this.initialUrlRequest?.toMap(),
'initialFile': this.initialFile,
'initialData': this.initialData?.toMap(),
2022-04-19 23:31:14 +00:00
'initialSettings': initialSettings,
'contextMenu': this.contextMenu?.toMap() ?? {},
'windowId': this.windowId,
'implementation': this.implementation.toValue(),
2021-02-22 22:54:09 +00:00
'initialUserScripts':
this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
2022-04-20 01:05:46 +00:00
'pullToRefreshSettings': pullToRefreshSettings,
'initialSize': this.initialSize.toMap()
});
await _sharedChannel.invokeMethod('run', args);
_running = true;
}
///Disposes the headless WebView.
2022-04-28 21:23:38 +00:00
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
Future<void> dispose() async {
if (!_running) {
return;
}
Map<String, dynamic> args = <String, dynamic>{};
await _channel.invokeMethod('dispose', args);
_started = false;
_running = false;
}
///Indicates if the headless WebView is running or not.
2022-04-28 21:23:38 +00:00
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
bool isRunning() {
return _running;
}
///Set the size of the WebView in pixels.
///
///Set `-1` to match the corresponding width or height of the current device screen size.
///`Size(-1, -1)` will match both width and height of the current device screen size.
///
///Note that if the [HeadlessInAppWebView] is not running, this method won't have effect.
///
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
2022-04-28 21:23:38 +00:00
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
Future<void> setSize(Size size) async {
if (!_running) {
return;
}
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('size', () => size.toMap());
await _channel.invokeMethod('setSize', args);
}
///Gets the current size in pixels of the WebView.
///
///Note that if the [HeadlessInAppWebView] is not running, this method will return `null`.
2022-04-28 21:23:38 +00:00
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
Future<Size?> getSize() async {
if (!_running) {
return null;
}
Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic> sizeMap =
(await _channel.invokeMethod('getSize', args))?.cast<String, dynamic>();
return MapSize.fromMap(sizeMap);
}
@override
final InAppWebViewInitialData? initialData;
@override
final String? initialFile;
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use initialSettings instead')
final InAppWebViewGroupOptions? initialOptions;
2022-04-19 23:31:14 +00:00
@override
final InAppWebViewSettings? initialSettings;
@override
final ContextMenu? contextMenu;
@override
final URLRequest? initialUrlRequest;
@override
final UnmodifiableListView<UserScript>? initialUserScripts;
@override
final PullToRefreshController? pullToRefreshController;
@override
final WebViewImplementation implementation;
2022-04-19 23:31:14 +00:00
///Use [onGeolocationPermissionsHidePrompt] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
void Function(InAppWebViewController controller)?
androidOnGeolocationPermissionsHidePrompt;
2022-04-19 23:31:14 +00:00
///Use [onGeolocationPermissionsShowPrompt] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
Future<GeolocationPermissionShowPromptResponse?> Function(
InAppWebViewController controller, String origin)?
androidOnGeolocationPermissionsShowPrompt;
2022-04-19 23:31:14 +00:00
///Use [onPermissionRequest] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onPermissionRequest instead')
Future<PermissionRequestResponse?> Function(InAppWebViewController controller,
String origin, List<String> resources)? androidOnPermissionRequest;
2022-04-19 23:31:14 +00:00
///Use [onSafeBrowsingHit] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onSafeBrowsingHit instead')
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
@override
void Function(InAppWebViewController controller, Uri? url)?
onPageCommitVisible;
@override
void Function(InAppWebViewController controller, String? title)?
2020-06-29 14:37:36 +00:00
onTitleChanged;
2022-04-19 23:31:14 +00:00
///Use [onDidReceiveServerRedirectForProvisionalNavigation] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
void Function(InAppWebViewController controller)?
iosOnDidReceiveServerRedirectForProvisionalNavigation;
2022-04-19 23:31:14 +00:00
///Use [onWebContentProcessDidTerminate] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onWebContentProcessDidTerminate instead')
void Function(InAppWebViewController controller)?
iosOnWebContentProcessDidTerminate;
2022-04-19 23:31:14 +00:00
///Use [onNavigationResponse] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onNavigationResponse instead')
Future<IOSNavigationResponseAction?> Function(
2021-02-22 22:54:09 +00:00
InAppWebViewController controller,
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
2022-04-19 23:31:14 +00:00
///Use [shouldAllowDeprecatedTLS] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use shouldAllowDeprecatedTLS instead')
Future<IOSShouldAllowDeprecatedTLSAction?> Function(
2021-02-22 22:54:09 +00:00
InAppWebViewController controller,
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
@override
Future<AjaxRequestAction> Function(
InAppWebViewController controller, AjaxRequest ajaxRequest)?
onAjaxProgress;
@override
Future<AjaxRequestAction?> Function(
InAppWebViewController controller, AjaxRequest ajaxRequest)?
onAjaxReadyStateChange;
@override
void Function(
InAppWebViewController controller, ConsoleMessage consoleMessage)?
onConsoleMessage;
@override
Future<bool?> Function(InAppWebViewController controller,
CreateWindowAction createWindowAction)? onCreateWindow;
@override
void Function(InAppWebViewController controller)? onCloseWindow;
@override
void Function(InAppWebViewController controller)? onWindowFocus;
@override
void Function(InAppWebViewController controller)? onWindowBlur;
2022-04-17 14:19:31 +00:00
///Use [onDownloadStartRequest] instead
2022-04-19 23:31:14 +00:00
@Deprecated('Use onDownloadStartRequest instead')
@override
void Function(InAppWebViewController controller, Uri url)? onDownloadStart;
2022-04-17 14:19:31 +00:00
@override
void Function(InAppWebViewController controller,
2022-04-18 22:42:57 +00:00
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
@override
void Function(InAppWebViewController controller, int activeMatchOrdinal,
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
@override
Future<JsAlertResponse?> Function(
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
2020-06-29 14:37:36 +00:00
onJsAlert;
@override
Future<JsConfirmResponse?> Function(
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
2020-06-29 14:37:36 +00:00
onJsConfirm;
@override
Future<JsPromptResponse?> Function(
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
2020-06-29 14:37:36 +00:00
onJsPrompt;
///Use [onReceivedError] instead.
@Deprecated("Use onReceivedError instead")
@override
void Function(InAppWebViewController controller, Uri? url, int code,
String message)? onLoadError;
@override
void Function(InAppWebViewController controller, WebResourceRequest request,
WebResourceError error)? onReceivedError;
///Use [onReceivedHttpError] instead.
@Deprecated("Use onReceivedHttpError instead")
@override
void Function(InAppWebViewController controller, Uri? url, int statusCode,
String description)? onLoadHttpError;
void Function(InAppWebViewController controller, WebResourceRequest request,
WebResourceResponse errorResponse)? onReceivedHttpError;
@override
void Function(InAppWebViewController controller, LoadedResource resource)?
onLoadResource;
///Use [onLoadResourceWithCustomScheme] instead.
@Deprecated('Use onLoadResourceWithCustomScheme instead')
@override
2022-05-08 23:51:21 +00:00
Future<CustomSchemeResponse?> Function(
2021-02-22 22:54:09 +00:00
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
@override
2022-05-08 23:51:21 +00:00
Future<CustomSchemeResponse?> Function(
InAppWebViewController controller, WebResourceRequest request)? onLoadResourceWithCustomScheme;
@override
void Function(InAppWebViewController controller, Uri? url)? onLoadStart;
@override
void Function(InAppWebViewController controller, Uri? url)? onLoadStop;
@override
void Function(InAppWebViewController controller,
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
@override
void Function(InAppWebViewController controller, Uri? url)? onPrint;
@override
void Function(InAppWebViewController controller, int progress)?
onProgressChanged;
@override
Future<ClientCertResponse?> Function(InAppWebViewController controller,
2021-02-22 22:54:09 +00:00
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
@override
Future<HttpAuthResponse?> Function(InAppWebViewController controller,
2021-02-22 22:54:09 +00:00
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
@override
Future<ServerTrustAuthResponse?> Function(InAppWebViewController controller,
2021-02-22 22:54:09 +00:00
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
@override
void Function(InAppWebViewController controller, int x, int y)?
onScrollChanged;
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller, Uri? url, bool? isReload)?
onUpdateVisitedHistory;
@override
void Function(InAppWebViewController controller)? onWebViewCreated;
@override
Future<AjaxRequest?> Function(
InAppWebViewController controller, AjaxRequest ajaxRequest)?
shouldInterceptAjaxRequest;
@override
Future<FetchRequest?> Function(
InAppWebViewController controller, FetchRequest fetchRequest)?
shouldInterceptFetchRequest;
@override
Future<NavigationActionPolicy?> Function(
InAppWebViewController controller, NavigationAction navigationAction)?
shouldOverrideUrlLoading;
2020-05-23 17:33:54 +00:00
@override
void Function(InAppWebViewController controller)? onEnterFullscreen;
2020-05-23 17:33:54 +00:00
@override
void Function(InAppWebViewController controller)? onExitFullscreen;
@override
void Function(InAppWebViewController controller, int x, int y, bool clampedX,
bool clampedY)? onOverScrolled;
@override
void Function(
InAppWebViewController controller, double oldScale, double newScale)?
onZoomScaleChanged;
2022-04-19 23:31:14 +00:00
///Use [shouldInterceptRequest] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use shouldInterceptRequest instead')
Future<WebResourceResponse?> Function(
InAppWebViewController controller, WebResourceRequest request)?
androidShouldInterceptRequest;
2022-04-19 23:31:14 +00:00
///Use [onRenderProcessUnresponsive] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onRenderProcessUnresponsive instead')
Future<WebViewRenderProcessAction?> Function(
InAppWebViewController controller, Uri? url)?
androidOnRenderProcessUnresponsive;
2022-04-19 23:31:14 +00:00
///Use [onRenderProcessResponsive] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onRenderProcessResponsive instead')
Future<WebViewRenderProcessAction?> Function(
InAppWebViewController controller, Uri? url)?
androidOnRenderProcessResponsive;
2022-04-19 23:31:14 +00:00
///Use [onRenderProcessGone] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onRenderProcessGone instead')
void Function(
InAppWebViewController controller, RenderProcessGoneDetail detail)?
androidOnRenderProcessGone;
2022-04-19 23:31:14 +00:00
///Use [onFormResubmission] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onFormResubmission instead')
Future<FormResubmissionAction?> Function(
InAppWebViewController controller, Uri? url)? androidOnFormResubmission;
///Use [onZoomScaleChanged] instead.
2022-04-19 23:31:14 +00:00
@Deprecated('Use onZoomScaleChanged instead')
@override
void Function(
InAppWebViewController controller, double oldScale, double newScale)?
androidOnScaleChanged;
2022-04-19 23:31:14 +00:00
///Use [onReceivedIcon] instead
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onReceivedIcon instead')
void Function(InAppWebViewController controller, Uint8List icon)?
2020-06-29 14:37:36 +00:00
androidOnReceivedIcon;
2022-04-19 23:31:14 +00:00
///Use [onReceivedTouchIconUrl] instead
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onReceivedTouchIconUrl instead')
void Function(InAppWebViewController controller, Uri url, bool precomposed)?
2020-06-29 14:37:36 +00:00
androidOnReceivedTouchIconUrl;
2022-04-19 23:31:14 +00:00
///Use [onJsBeforeUnload] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onJsBeforeUnload instead')
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload;
2022-04-19 23:31:14 +00:00
///Use [onReceivedLoginRequest] instead.
@override
2022-04-19 23:31:14 +00:00
@Deprecated('Use onReceivedLoginRequest instead')
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
2020-06-29 14:37:36 +00:00
androidOnReceivedLoginRequest;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller)?
onDidReceiveServerRedirectForProvisionalNavigation;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<FormResubmissionAction?> Function(
InAppWebViewController controller, Uri? url)? onFormResubmission;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller)?
onGeolocationPermissionsHidePrompt;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<GeolocationPermissionShowPromptResponse?> Function(
InAppWebViewController controller, String origin)?
onGeolocationPermissionsShowPrompt;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<NavigationResponseAction?> Function(InAppWebViewController controller,
NavigationResponse navigationResponse)? onNavigationResponse;
2022-04-19 23:31:14 +00:00
@override
2022-04-21 10:20:48 +00:00
Future<PermissionResponse?> Function(InAppWebViewController controller,
PermissionRequest permissionRequest)? onPermissionRequest;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller, Uint8List icon)?
onReceivedIcon;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
onReceivedLoginRequest;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller, Uri url, bool precomposed)?
onReceivedTouchIconUrl;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(
InAppWebViewController controller, RenderProcessGoneDetail detail)?
onRenderProcessGone;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<WebViewRenderProcessAction?> Function(
InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<WebViewRenderProcessAction?> Function(
InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
Uri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
void Function(InAppWebViewController controller)?
onWebContentProcessDidTerminate;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<ShouldAllowDeprecatedTLSAction?> Function(
InAppWebViewController controller,
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
2022-04-19 23:31:14 +00:00
@override
2022-04-20 01:05:46 +00:00
Future<WebResourceResponse?> Function(
InAppWebViewController controller, WebResourceRequest request)?
shouldInterceptRequest;
@override
Future<void> Function(
InAppWebViewController controller,
MediaCaptureState? oldState,
MediaCaptureState? newState,
)? onCameraCaptureStateChanged;
@override
Future<void> Function(
InAppWebViewController controller,
MediaCaptureState? oldState,
MediaCaptureState? newState,
)? onMicrophoneCaptureStateChanged;
}