code format

This commit is contained in:
Lorenzo Pichilli 2023-11-11 19:09:10 +01:00
parent 18c3c1fa51
commit d5a0bb3e3e
21 changed files with 152 additions and 179 deletions

View File

@ -295,7 +295,8 @@ class ChromeSafariBrowser extends ChannelController {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('relation', () => relation.toNativeValue()); args.putIfAbsent('relation', () => relation.toNativeValue());
args.putIfAbsent('origin', () => origin.toString()); args.putIfAbsent('origin', () => origin.toString());
return await channel?.invokeMethod<bool>("validateRelationship", args) ?? false; return await channel?.invokeMethod<bool>("validateRelationship", args) ??
false;
} }
///Closes the [ChromeSafariBrowser] instance. ///Closes the [ChromeSafariBrowser] instance.
@ -401,7 +402,8 @@ class ChromeSafariBrowser extends ChannelController {
///- Android ///- Android
static Future<int> getMaxToolbarItems() async { static Future<int> getMaxToolbarItems() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
return await _sharedChannel.invokeMethod<int>("getMaxToolbarItems", args) ?? 0; return await _sharedChannel.invokeMethod<int>("getMaxToolbarItems", args) ??
0;
} }
///Clear associated website data accrued from browsing activity within your app. ///Clear associated website data accrued from browsing activity within your app.

View File

@ -92,7 +92,7 @@ class CookieManager {
bool? isHttpOnly, bool? isHttpOnly,
HTTPCookieSameSitePolicy? sameSite, HTTPCookieSameSitePolicy? sameSite,
@Deprecated("Use webViewController instead") @Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController, InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async { InAppWebViewController? webViewController}) async {
webViewController = webViewController ?? iosBelow11WebViewController; webViewController = webViewController ?? iosBelow11WebViewController;
@ -204,7 +204,7 @@ class CookieManager {
Future<List<Cookie>> getCookies( Future<List<Cookie>> getCookies(
{required WebUri url, {required WebUri url,
@Deprecated("Use webViewController instead") @Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController, InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async { InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty); assert(url.toString().isNotEmpty);
@ -318,7 +318,7 @@ class CookieManager {
{required WebUri url, {required WebUri url,
required String name, required String name,
@Deprecated("Use webViewController instead") @Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController, InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async { InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty); assert(url.toString().isNotEmpty);
assert(name.isNotEmpty); assert(name.isNotEmpty);
@ -381,7 +381,7 @@ class CookieManager {
String path = "/", String path = "/",
String? domain, String? domain,
@Deprecated("Use webViewController instead") @Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController, InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async { InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty); assert(url.toString().isNotEmpty);
assert(name.isNotEmpty); assert(name.isNotEmpty);
@ -433,7 +433,7 @@ class CookieManager {
String path = "/", String path = "/",
String? domain, String? domain,
@Deprecated("Use webViewController instead") @Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController, InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async { InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty); assert(url.toString().isNotEmpty);

View File

@ -70,8 +70,7 @@ class InAppBrowser extends ChannelController {
} }
_init() { _init() {
channel = channel = MethodChannel('com.pichillilorenzo/flutter_inappbrowser_$id');
MethodChannel('com.pichillilorenzo/flutter_inappbrowser_$id');
handler = _handleMethod; handler = _handleMethod;
initMethodCallHandler(); initMethodCallHandler();

View File

@ -86,7 +86,9 @@ class InAppLocalhostServer {
path = _documentRoot + path; path = _documentRoot + path;
try { try {
body = (await rootBundle.load(Uri.decodeFull(path))).buffer.asUint8List(); body = (await rootBundle.load(Uri.decodeFull(path)))
.buffer
.asUint8List();
} catch (e) { } catch (e) {
print(e.toString()); print(e.toString());
request.response.close(); request.response.close();

View File

@ -26,8 +26,8 @@ class IOSInAppWebViewController {
@Deprecated("Use InAppWebViewController.createPdf instead") @Deprecated("Use InAppWebViewController.createPdf instead")
Future<Uint8List?> createPdf( Future<Uint8List?> createPdf(
{@Deprecated("Use pdfConfiguration instead") {@Deprecated("Use pdfConfiguration instead")
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
IOSWKPDFConfiguration? iosWKPdfConfiguration, IOSWKPDFConfiguration? iosWKPdfConfiguration,
PDFConfiguration? pdfConfiguration}) async { PDFConfiguration? pdfConfiguration}) async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('pdfConfiguration', args.putIfAbsent('pdfConfiguration',

View File

@ -29,7 +29,8 @@ import '../types/disposable.dart';
///- Web ///- Web
///- MacOS ///- MacOS
///{@endtemplate} ///{@endtemplate}
class HeadlessInAppWebView extends ChannelController implements WebView, Disposable { class HeadlessInAppWebView extends ChannelController
implements WebView, Disposable {
///View ID. ///View ID.
late final String id; late final String id;
@ -68,8 +69,7 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.initialUrlRequest, this.initialUrlRequest,
this.initialFile, this.initialFile,
this.initialData, this.initialData,
@Deprecated('Use initialSettings instead') @Deprecated('Use initialSettings instead') this.initialOptions,
this.initialOptions,
this.initialSettings, this.initialSettings,
this.contextMenu, this.contextMenu,
this.initialUserScripts, this.initialUserScripts,
@ -78,22 +78,19 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onWebViewCreated, this.onWebViewCreated,
this.onLoadStart, this.onLoadStart,
this.onLoadStop, this.onLoadStop,
@Deprecated("Use onReceivedError instead") @Deprecated("Use onReceivedError instead") this.onLoadError,
this.onLoadError,
this.onReceivedError, this.onReceivedError,
@Deprecated("Use onReceivedHttpError instead") @Deprecated("Use onReceivedHttpError instead") this.onLoadHttpError,
this.onLoadHttpError,
this.onReceivedHttpError, this.onReceivedHttpError,
this.onProgressChanged, this.onProgressChanged,
this.onConsoleMessage, this.onConsoleMessage,
this.shouldOverrideUrlLoading, this.shouldOverrideUrlLoading,
this.onLoadResource, this.onLoadResource,
this.onScrollChanged, this.onScrollChanged,
@Deprecated('Use onDownloadStartRequest instead') @Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStart,
this.onDownloadStartRequest, this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead') @Deprecated('Use onLoadResourceWithCustomScheme instead')
this.onLoadResourceCustomScheme, this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme, this.onLoadResourceWithCustomScheme,
this.onCreateWindow, this.onCreateWindow,
this.onCloseWindow, this.onCloseWindow,
@ -104,14 +101,13 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onReceivedServerTrustAuthRequest, this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest, this.onReceivedClientCertRequest,
@Deprecated('Use FindInteractionController.onFindResultReceived instead') @Deprecated('Use FindInteractionController.onFindResultReceived instead')
this.onFindResultReceived, this.onFindResultReceived,
this.shouldInterceptAjaxRequest, this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange, this.onAjaxReadyStateChange,
this.onAjaxProgress, this.onAjaxProgress,
this.shouldInterceptFetchRequest, this.shouldInterceptFetchRequest,
this.onUpdateVisitedHistory, this.onUpdateVisitedHistory,
@Deprecated("Use onPrintRequest instead") @Deprecated("Use onPrintRequest instead") this.onPrint,
this.onPrint,
this.onPrintRequest, this.onPrintRequest,
this.onLongPressHitTestResult, this.onLongPressHitTestResult,
this.onEnterFullscreen, this.onEnterFullscreen,
@ -122,59 +118,57 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onWindowBlur, this.onWindowBlur,
this.onOverScrolled, this.onOverScrolled,
@Deprecated('Use onSafeBrowsingHit instead') @Deprecated('Use onSafeBrowsingHit instead')
this.androidOnSafeBrowsingHit, this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit, this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead') @Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest, this.androidOnPermissionRequest,
this.onPermissionRequest, this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') @Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt, this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt, this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') @Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt, this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt, this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead') @Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest, this.androidShouldInterceptRequest,
this.shouldInterceptRequest, this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead') @Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone, this.androidOnRenderProcessGone,
this.onRenderProcessGone, this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead') @Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive, this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive, this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead') @Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive, this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive, this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead') @Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission, this.androidOnFormResubmission,
this.onFormResubmission, this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead') @Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
this.androidOnScaleChanged, @Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
@Deprecated('Use onReceivedIcon instead')
this.androidOnReceivedIcon,
this.onReceivedIcon, this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead') @Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl, this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl, this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead') @Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.androidOnJsBeforeUnload,
this.onJsBeforeUnload, this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead') @Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest, this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest, this.onReceivedLoginRequest,
this.onPermissionRequestCanceled, this.onPermissionRequestCanceled,
this.onRequestFocus, this.onRequestFocus,
@Deprecated('Use onWebContentProcessDidTerminate instead') @Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate, this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate, this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') @Deprecated(
this.iosOnDidReceiveServerRedirectForProvisionalNavigation, 'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation, this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead') @Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse, this.iosOnNavigationResponse,
this.onNavigationResponse, this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead') @Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS, this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS, this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged, this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged, this.onMicrophoneCaptureStateChanged,
@ -364,8 +358,7 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic> sizeMap = Map<String, dynamic> sizeMap =
(await channel?.invokeMethod('getSize', args)) (await channel?.invokeMethod('getSize', args))?.cast<String, dynamic>();
?.cast<String, dynamic>();
return MapSize.fromMap(sizeMap); return MapSize.fromMap(sizeMap);
} }

View File

@ -101,7 +101,7 @@ class InAppWebView extends StatefulWidget implements WebView {
@Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart, @Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStartRequest, this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead') @Deprecated('Use onLoadResourceWithCustomScheme instead')
this.onLoadResourceCustomScheme, this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme, this.onLoadResourceWithCustomScheme,
this.onCreateWindow, this.onCreateWindow,
this.onCloseWindow, this.onCloseWindow,
@ -112,7 +112,7 @@ class InAppWebView extends StatefulWidget implements WebView {
this.onReceivedServerTrustAuthRequest, this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest, this.onReceivedClientCertRequest,
@Deprecated('Use FindInteractionController.onFindResultReceived instead') @Deprecated('Use FindInteractionController.onFindResultReceived instead')
this.onFindResultReceived, this.onFindResultReceived,
this.shouldInterceptAjaxRequest, this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange, this.onAjaxReadyStateChange,
this.onAjaxProgress, this.onAjaxProgress,
@ -132,53 +132,54 @@ class InAppWebView extends StatefulWidget implements WebView {
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit, @Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit, this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead') @Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest, this.androidOnPermissionRequest,
this.onPermissionRequest, this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') @Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt, this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt, this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') @Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt, this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt, this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead') @Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest, this.androidShouldInterceptRequest,
this.shouldInterceptRequest, this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead') @Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone, this.androidOnRenderProcessGone,
this.onRenderProcessGone, this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead') @Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive, this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive, this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead') @Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive, this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive, this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead') @Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission, this.androidOnFormResubmission,
this.onFormResubmission, this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged, @Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon, @Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
this.onReceivedIcon, this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead') @Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl, this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl, this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload, @Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.onJsBeforeUnload, this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead') @Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest, this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest, this.onReceivedLoginRequest,
this.onPermissionRequestCanceled, this.onPermissionRequestCanceled,
this.onRequestFocus, this.onRequestFocus,
@Deprecated('Use onWebContentProcessDidTerminate instead') @Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate, this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate, this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') @Deprecated(
this.iosOnDidReceiveServerRedirectForProvisionalNavigation, 'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation, this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead') @Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse, this.iosOnNavigationResponse,
this.onNavigationResponse, this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead') @Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS, this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS, this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged, this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged, this.onMicrophoneCaptureStateChanged,

View File

@ -1197,22 +1197,19 @@ abstract class WebView {
this.onWebViewCreated, this.onWebViewCreated,
this.onLoadStart, this.onLoadStart,
this.onLoadStop, this.onLoadStop,
@Deprecated('Use onReceivedError instead') @Deprecated('Use onReceivedError instead') this.onLoadError,
this.onLoadError,
this.onReceivedError, this.onReceivedError,
@Deprecated("Use onReceivedHttpError instead") @Deprecated("Use onReceivedHttpError instead") this.onLoadHttpError,
this.onLoadHttpError,
this.onReceivedHttpError, this.onReceivedHttpError,
this.onProgressChanged, this.onProgressChanged,
this.onConsoleMessage, this.onConsoleMessage,
this.shouldOverrideUrlLoading, this.shouldOverrideUrlLoading,
this.onLoadResource, this.onLoadResource,
this.onScrollChanged, this.onScrollChanged,
@Deprecated('Use onDownloadStartRequest instead') @Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStart,
this.onDownloadStartRequest, this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead') @Deprecated('Use onLoadResourceWithCustomScheme instead')
this.onLoadResourceCustomScheme, this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme, this.onLoadResourceWithCustomScheme,
this.onCreateWindow, this.onCreateWindow,
this.onCloseWindow, this.onCloseWindow,
@ -1223,14 +1220,13 @@ abstract class WebView {
this.onReceivedServerTrustAuthRequest, this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest, this.onReceivedClientCertRequest,
@Deprecated('Use FindInteractionController.onFindResultReceived instead') @Deprecated('Use FindInteractionController.onFindResultReceived instead')
this.onFindResultReceived, this.onFindResultReceived,
this.shouldInterceptAjaxRequest, this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange, this.onAjaxReadyStateChange,
this.onAjaxProgress, this.onAjaxProgress,
this.shouldInterceptFetchRequest, this.shouldInterceptFetchRequest,
this.onUpdateVisitedHistory, this.onUpdateVisitedHistory,
@Deprecated("Use onPrintRequest instead") @Deprecated("Use onPrintRequest instead") this.onPrint,
this.onPrint,
this.onPrintRequest, this.onPrintRequest,
this.onLongPressHitTestResult, this.onLongPressHitTestResult,
this.onEnterFullscreen, this.onEnterFullscreen,
@ -1242,59 +1238,57 @@ abstract class WebView {
this.onOverScrolled, this.onOverScrolled,
this.onZoomScaleChanged, this.onZoomScaleChanged,
@Deprecated('Use onSafeBrowsingHit instead') @Deprecated('Use onSafeBrowsingHit instead')
this.androidOnSafeBrowsingHit, this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit, this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead') @Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest, this.androidOnPermissionRequest,
this.onPermissionRequest, this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') @Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt, this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt, this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') @Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt, this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt, this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead') @Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest, this.androidShouldInterceptRequest,
this.shouldInterceptRequest, this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead') @Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone, this.androidOnRenderProcessGone,
this.onRenderProcessGone, this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead') @Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive, this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive, this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead') @Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive, this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive, this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead') @Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission, this.androidOnFormResubmission,
this.onFormResubmission, this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead') @Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
this.androidOnScaleChanged, @Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
@Deprecated('Use onReceivedIcon instead')
this.androidOnReceivedIcon,
this.onReceivedIcon, this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead') @Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl, this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl, this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead') @Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.androidOnJsBeforeUnload,
this.onJsBeforeUnload, this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead') @Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest, this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest, this.onReceivedLoginRequest,
this.onPermissionRequestCanceled, this.onPermissionRequestCanceled,
this.onRequestFocus, this.onRequestFocus,
@Deprecated('Use onWebContentProcessDidTerminate instead') @Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate, this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate, this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') @Deprecated(
this.iosOnDidReceiveServerRedirectForProvisionalNavigation, 'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation, this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead') @Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse, this.iosOnNavigationResponse,
this.onNavigationResponse, this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead') @Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS, this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS, this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged, this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged, this.onMicrophoneCaptureStateChanged,
@ -1302,8 +1296,7 @@ abstract class WebView {
this.initialUrlRequest, this.initialUrlRequest,
this.initialFile, this.initialFile,
this.initialData, this.initialData,
@Deprecated('Use initialSettings instead') @Deprecated('Use initialSettings instead') this.initialOptions,
this.initialOptions,
this.initialSettings, this.initialSettings,
this.contextMenu, this.contextMenu,
this.initialUserScripts, this.initialUserScripts,

View File

@ -93,8 +93,7 @@ class PrintJobController extends ChannelController {
Future<PrintJobInfo?> getInfo() async { Future<PrintJobInfo?> getInfo() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic>? infoMap = Map<String, dynamic>? infoMap =
(await channel?.invokeMethod('getInfo', args)) (await channel?.invokeMethod('getInfo', args))?.cast<String, dynamic>();
?.cast<String, dynamic>();
return PrintJobInfo.fromMap(infoMap); return PrintJobInfo.fromMap(infoMap);
} }

View File

@ -176,7 +176,9 @@ class PullToRefreshController extends ChannelController {
///- Android native WebView ([Official API - SwipeRefreshLayout.DEFAULT_SLINGSHOT_DISTANCE](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#DEFAULT_SLINGSHOT_DISTANCE())) ///- Android native WebView ([Official API - SwipeRefreshLayout.DEFAULT_SLINGSHOT_DISTANCE](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#DEFAULT_SLINGSHOT_DISTANCE()))
Future<int> getDefaultSlingshotDistance() async { Future<int> getDefaultSlingshotDistance() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<int>('getDefaultSlingshotDistance', args) ?? 0; return await channel?.invokeMethod<int>(
'getDefaultSlingshotDistance', args) ??
0;
} }
///Use [setIndicatorSize] instead. ///Use [setIndicatorSize] instead.

View File

@ -33,7 +33,7 @@ class ClientCertResponse_ {
{required this.certificatePath, {required this.certificatePath,
this.certificatePassword = "", this.certificatePassword = "",
@Deprecated('Use keyStoreType instead') @Deprecated('Use keyStoreType instead')
this.androidKeyStoreType = "PKCS12", this.androidKeyStoreType = "PKCS12",
this.keyStoreType = "PKCS12", this.keyStoreType = "PKCS12",
this.action = ClientCertResponseAction_.CANCEL}) { this.action = ClientCertResponseAction_.CANCEL}) {
if (this.action == ClientCertResponseAction_.PROCEED) if (this.action == ClientCertResponseAction_.PROCEED)

View File

@ -30,7 +30,7 @@ class ClientCertResponse {
{required this.certificatePath, {required this.certificatePath,
this.certificatePassword = "", this.certificatePassword = "",
@Deprecated('Use keyStoreType instead') @Deprecated('Use keyStoreType instead')
this.androidKeyStoreType = "PKCS12", this.androidKeyStoreType = "PKCS12",
this.keyStoreType = "PKCS12", this.keyStoreType = "PKCS12",
this.action = ClientCertResponseAction.CANCEL}) { this.action = ClientCertResponseAction.CANCEL}) {
if (this.action == ClientCertResponseAction.PROCEED) if (this.action == ClientCertResponseAction.PROCEED)

View File

@ -42,31 +42,27 @@ class CreateWindowAction_ extends NavigationAction_ {
CreateWindowAction_( CreateWindowAction_(
{required this.windowId, {required this.windowId,
@Deprecated('Use isDialog instead') @Deprecated('Use isDialog instead') this.androidIsDialog,
this.androidIsDialog,
this.isDialog, this.isDialog,
@Deprecated('Use windowFeatures instead') @Deprecated('Use windowFeatures instead') this.iosWindowFeatures,
this.iosWindowFeatures,
this.windowFeatures, this.windowFeatures,
required URLRequest_ request, required URLRequest_ request,
required bool isForMainFrame, required bool isForMainFrame,
@Deprecated('Use hasGesture instead') @Deprecated('Use hasGesture instead') bool? androidHasGesture,
bool? androidHasGesture, @Deprecated('Use isRedirect instead') bool? androidIsRedirect,
@Deprecated('Use isRedirect instead')
bool? androidIsRedirect,
bool? hasGesture, bool? hasGesture,
bool? isRedirect, bool? isRedirect,
@Deprecated('Use navigationType instead') @Deprecated('Use navigationType instead')
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
IOSWKNavigationType_? iosWKNavigationType, IOSWKNavigationType_? iosWKNavigationType,
NavigationType_? navigationType, NavigationType_? navigationType,
@Deprecated('Use sourceFrame instead') @Deprecated('Use sourceFrame instead')
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
IOSWKFrameInfo_? iosSourceFrame, IOSWKFrameInfo_? iosSourceFrame,
FrameInfo_? sourceFrame, FrameInfo_? sourceFrame,
@Deprecated('Use targetFrame instead') @Deprecated('Use targetFrame instead')
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
IOSWKFrameInfo_? iosTargetFrame, IOSWKFrameInfo_? iosTargetFrame,
FrameInfo_? targetFrame}) FrameInfo_? targetFrame})
: super( : super(
request: request, request: request,

View File

@ -32,29 +32,23 @@ class CreateWindowAction extends NavigationAction {
///The window id. Used by [WebView] to create a new WebView. ///The window id. Used by [WebView] to create a new WebView.
int windowId; int windowId;
CreateWindowAction( CreateWindowAction(
{@Deprecated('Use isDialog instead') {@Deprecated('Use isDialog instead') this.androidIsDialog,
this.androidIsDialog, @Deprecated('Use windowFeatures instead') this.iosWindowFeatures,
@Deprecated('Use windowFeatures instead')
this.iosWindowFeatures,
this.isDialog, this.isDialog,
this.windowFeatures, this.windowFeatures,
required this.windowId, required this.windowId,
required URLRequest request, required URLRequest request,
required bool isForMainFrame, required bool isForMainFrame,
@Deprecated('Use hasGesture instead') @Deprecated('Use hasGesture instead') bool? androidHasGesture,
bool? androidHasGesture,
bool? hasGesture, bool? hasGesture,
@Deprecated('Use isRedirect instead') @Deprecated('Use isRedirect instead') bool? androidIsRedirect,
bool? androidIsRedirect,
bool? isRedirect, bool? isRedirect,
@Deprecated('Use navigationType instead') @Deprecated('Use navigationType instead')
IOSWKNavigationType? iosWKNavigationType, IOSWKNavigationType? iosWKNavigationType,
NavigationType? navigationType, NavigationType? navigationType,
@Deprecated('Use sourceFrame instead') @Deprecated('Use sourceFrame instead') IOSWKFrameInfo? iosSourceFrame,
IOSWKFrameInfo? iosSourceFrame,
FrameInfo? sourceFrame, FrameInfo? sourceFrame,
@Deprecated('Use targetFrame instead') @Deprecated('Use targetFrame instead') IOSWKFrameInfo? iosTargetFrame,
IOSWKFrameInfo? iosTargetFrame,
FrameInfo? targetFrame, FrameInfo? targetFrame,
bool? shouldPerformDownload}) bool? shouldPerformDownload})
: super( : super(

View File

@ -132,15 +132,13 @@ class URLProtectionSpace_ {
this.sslCertificate, this.sslCertificate,
this.sslError, this.sslError,
@Deprecated("Use authenticationMethod instead") @Deprecated("Use authenticationMethod instead")
this.iosAuthenticationMethod, this.iosAuthenticationMethod,
this.authenticationMethod, this.authenticationMethod,
@Deprecated("Use distinguishedNames instead") @Deprecated("Use distinguishedNames instead") this.iosDistinguishedNames,
this.iosDistinguishedNames,
this.distinguishedNames, this.distinguishedNames,
@Deprecated("Use receivesCredentialSecurely instead") @Deprecated("Use receivesCredentialSecurely instead")
this.iosReceivesCredentialSecurely, this.iosReceivesCredentialSecurely,
this.receivesCredentialSecurely, this.receivesCredentialSecurely,
@Deprecated("Use proxyType instead") @Deprecated("Use proxyType instead") this.iosProxyType,
this.iosProxyType,
this.proxyType}); this.proxyType});
} }

View File

@ -81,13 +81,11 @@ class URLProtectionSpace {
this.distinguishedNames, this.distinguishedNames,
required this.host, required this.host,
@Deprecated('Use authenticationMethod instead') @Deprecated('Use authenticationMethod instead')
this.iosAuthenticationMethod, this.iosAuthenticationMethod,
@Deprecated('Use distinguishedNames instead') @Deprecated('Use distinguishedNames instead') this.iosDistinguishedNames,
this.iosDistinguishedNames, @Deprecated('Use proxyType instead') this.iosProxyType,
@Deprecated('Use proxyType instead')
this.iosProxyType,
@Deprecated('Use receivesCredentialSecurely instead') @Deprecated('Use receivesCredentialSecurely instead')
this.iosReceivesCredentialSecurely, this.iosReceivesCredentialSecurely,
this.port, this.port,
this.protocol, this.protocol,
this.proxyType, this.proxyType,

View File

@ -223,31 +223,27 @@ class URLRequest_ {
this.headers, this.headers,
this.body, this.body,
@Deprecated("Use allowsCellularAccess instead") @Deprecated("Use allowsCellularAccess instead")
this.iosAllowsCellularAccess, this.iosAllowsCellularAccess,
this.allowsCellularAccess, this.allowsCellularAccess,
@Deprecated("Use allowsConstrainedNetworkAccess instead") @Deprecated("Use allowsConstrainedNetworkAccess instead")
this.iosAllowsConstrainedNetworkAccess, this.iosAllowsConstrainedNetworkAccess,
this.allowsConstrainedNetworkAccess, this.allowsConstrainedNetworkAccess,
@Deprecated("Use allowsExpensiveNetworkAccess instead") @Deprecated("Use allowsExpensiveNetworkAccess instead")
this.iosAllowsExpensiveNetworkAccess, this.iosAllowsExpensiveNetworkAccess,
this.allowsExpensiveNetworkAccess, this.allowsExpensiveNetworkAccess,
@Deprecated("Use cachePolicy instead") @Deprecated("Use cachePolicy instead") this.iosCachePolicy,
this.iosCachePolicy,
this.cachePolicy, this.cachePolicy,
@Deprecated("Use httpShouldHandleCookies instead") @Deprecated("Use httpShouldHandleCookies instead")
this.iosHttpShouldHandleCookies, this.iosHttpShouldHandleCookies,
this.httpShouldHandleCookies, this.httpShouldHandleCookies,
@Deprecated("Use httpShouldUsePipelining instead") @Deprecated("Use httpShouldUsePipelining instead")
this.iosHttpShouldUsePipelining, this.iosHttpShouldUsePipelining,
this.httpShouldUsePipelining, this.httpShouldUsePipelining,
@Deprecated("Use networkServiceType instead") @Deprecated("Use networkServiceType instead") this.iosNetworkServiceType,
this.iosNetworkServiceType,
this.networkServiceType, this.networkServiceType,
@Deprecated("Use timeoutInterval instead") @Deprecated("Use timeoutInterval instead") this.iosTimeoutInterval,
this.iosTimeoutInterval,
this.timeoutInterval, this.timeoutInterval,
@Deprecated("Use mainDocumentURL instead") @Deprecated("Use mainDocumentURL instead") this.iosMainDocumentURL,
this.iosMainDocumentURL,
this.mainDocumentURL, this.mainDocumentURL,
this.assumesHTTP3Capable, this.assumesHTTP3Capable,
this.attribution}); this.attribution});

View File

@ -151,23 +151,19 @@ class URLRequest {
this.httpShouldHandleCookies, this.httpShouldHandleCookies,
this.httpShouldUsePipelining, this.httpShouldUsePipelining,
@Deprecated('Use allowsCellularAccess instead') @Deprecated('Use allowsCellularAccess instead')
this.iosAllowsCellularAccess, this.iosAllowsCellularAccess,
@Deprecated('Use allowsConstrainedNetworkAccess instead') @Deprecated('Use allowsConstrainedNetworkAccess instead')
this.iosAllowsConstrainedNetworkAccess, this.iosAllowsConstrainedNetworkAccess,
@Deprecated('Use allowsExpensiveNetworkAccess instead') @Deprecated('Use allowsExpensiveNetworkAccess instead')
this.iosAllowsExpensiveNetworkAccess, this.iosAllowsExpensiveNetworkAccess,
@Deprecated('Use cachePolicy instead') @Deprecated('Use cachePolicy instead') this.iosCachePolicy,
this.iosCachePolicy,
@Deprecated('Use httpShouldHandleCookies instead') @Deprecated('Use httpShouldHandleCookies instead')
this.iosHttpShouldHandleCookies, this.iosHttpShouldHandleCookies,
@Deprecated('Use httpShouldUsePipelining instead') @Deprecated('Use httpShouldUsePipelining instead')
this.iosHttpShouldUsePipelining, this.iosHttpShouldUsePipelining,
@Deprecated('Use mainDocumentURL instead') @Deprecated('Use mainDocumentURL instead') this.iosMainDocumentURL,
this.iosMainDocumentURL, @Deprecated('Use networkServiceType instead') this.iosNetworkServiceType,
@Deprecated('Use networkServiceType instead') @Deprecated('Use timeoutInterval instead') this.iosTimeoutInterval,
this.iosNetworkServiceType,
@Deprecated('Use timeoutInterval instead')
this.iosTimeoutInterval,
this.mainDocumentURL, this.mainDocumentURL,
this.method, this.method,
this.networkServiceType, this.networkServiceType,

View File

@ -594,8 +594,8 @@ abstract class ChannelController implements Disposable {
if (controller.disposed) { if (controller.disposed) {
throw FlutterError( throw FlutterError(
'A ${controller.runtimeType} was used after being disposed.\n' 'A ${controller.runtimeType} was used after being disposed.\n'
'Once the ${controller.runtimeType} has been disposed, it ' 'Once the ${controller.runtimeType} has been disposed, it '
'can no longer be used.', 'can no longer be used.',
); );
} }
return true; return true;
@ -605,22 +605,25 @@ abstract class ChannelController implements Disposable {
} }
extension InternalChannelController on ChannelController { extension InternalChannelController on ChannelController {
set channel (MethodChannel? channel) => _channel = channel; set channel(MethodChannel? channel) => _channel = channel;
MethodChannel? get channel { MethodChannel? get channel {
assert(ChannelController.debugAssertNotDisposed(this)); assert(ChannelController.debugAssertNotDisposed(this));
return this._channel; return this._channel;
} }
set handler (Future<dynamic> Function(MethodCall call)? handler) => _handler = handler; set handler(Future<dynamic> Function(MethodCall call)? handler) =>
_handler = handler;
Future<dynamic> Function(MethodCall call)? get handler => _handler; Future<dynamic> Function(MethodCall call)? get handler => _handler;
bool get disposed => _channel == null; bool get disposed => _channel == null;
initMethodCallHandler() { initMethodCallHandler() {
assert(channel != null, 'Method Channel for ${runtimeType} not initialized!'); assert(
assert(handler != null, 'Method Call Handler for ${runtimeType} not initialized!'); channel != null, 'Method Channel for ${runtimeType} not initialized!');
assert(handler != null,
'Method Call Handler for ${runtimeType} not initialized!');
channel?.setMethodCallHandler((call) async { channel?.setMethodCallHandler((call) async {
if (disposed) return null; if (disposed) return null;
@ -640,4 +643,4 @@ extension InternalChannelController on ChannelController {
channel = null; channel = null;
handler = null; handler = null;
} }
} }

View File

@ -186,6 +186,7 @@ class WebAuthenticationSession extends ChannelController {
///- iOS ///- iOS
static Future<bool> isAvailable() async { static Future<bool> isAvailable() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
return await _sharedChannel.invokeMethod<bool>("isAvailable", args) ?? false; return await _sharedChannel.invokeMethod<bool>("isAvailable", args) ??
false;
} }
} }

View File

@ -43,7 +43,7 @@ class WebMessageListener extends ChannelController {
allowedOriginRules != null ? allowedOriginRules : Set.from(["*"]); allowedOriginRules != null ? allowedOriginRules : Set.from(["*"]);
assert(!this.allowedOriginRules.contains(""), assert(!this.allowedOriginRules.contains(""),
"allowedOriginRules cannot contain empty strings"); "allowedOriginRules cannot contain empty strings");
channel= MethodChannel( channel = MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_web_message_listener_${id}_$jsObjectName'); 'com.pichillilorenzo/flutter_inappwebview_web_message_listener_${id}_$jsObjectName');
handler = _handleMethod; handler = _handleMethod;
initMethodCallHandler(); initMethodCallHandler();