diff --git a/packages/webview_flutter/webview_flutter/CHANGELOG.md b/packages/webview_flutter/webview_flutter/CHANGELOG.md index 1d95b3b902a..b10794ffdcf 100644 --- a/packages/webview_flutter/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 4.11.0 -* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. +* Adds support to set the over-scroll mode for the WebView. See `WebViewController.setOverScrollMode`. +* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6. ## 4.10.0 diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index e6152419a9a..5c0fb7ecf99 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -17,8 +17,8 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_android: ^4.0.0 - webview_flutter_wkwebview: ^3.13.0 + webview_flutter_android: ^4.4.0 + webview_flutter_wkwebview: ^3.19.0 dev_dependencies: build_runner: ^2.1.5 @@ -27,7 +27,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - webview_flutter_platform_interface: ^2.10.0 + webview_flutter_platform_interface: ^2.11.0 flutter: uses-material-design: true diff --git a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart index 603f9cf4be3..6b720c9c753 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart @@ -405,6 +405,13 @@ class WebViewController { ) { return platform.setOnScrollPositionChange(onScrollPositionChange); } + + /// Sets the over-scroll mode for the WebView. + /// + /// Default behavior is platform dependent. + Future setOverScrollMode(WebViewOverScrollMode mode) async { + return platform.setOverScrollMode(mode); + } } /// Permissions request when web content requests access to protected resources. diff --git a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart index e135e3c5bcb..b1b237d3140 100644 --- a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart @@ -34,6 +34,7 @@ export 'package:webview_flutter_platform_interface/webview_flutter_platform_inte WebResourceResponse, WebViewCookie, WebViewCredential, + WebViewOverScrollMode, WebViewPermissionResourceType, WebViewPlatform; diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 837800d7fee..c609edc11ff 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -2,11 +2,11 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget backed by the system webview. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.10.0 +version: 4.11.0 environment: - sdk: ^3.5.0 - flutter: ">=3.24.0" + sdk: ^3.6.0 + flutter: ">=3.27.0" flutter: plugin: @@ -21,9 +21,9 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_android: ^4.0.0 - webview_flutter_platform_interface: ^2.10.0 - webview_flutter_wkwebview: ^3.15.0 + webview_flutter_android: ^4.4.0 + webview_flutter_platform_interface: ^2.11.0 + webview_flutter_wkwebview: ^3.19.0 dev_dependencies: build_runner: ^2.1.5 diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart index ff3f06b0e65..7a3c4d583a9 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter/test/legacy/webview_flutter_test.dart. // Do not manually edit this file. @@ -29,19 +29,15 @@ import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { - _FakeWidget_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWidget_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => @@ -67,41 +63,30 @@ class MockWebViewPlatform extends _i1.Mock implements _i4.WebViewPlatform { Set<_i3.Factory<_i8.OneSequenceGestureRecognizer>>? gestureRecognizers, }) => (super.noSuchMethod( - Invocation.method( - #build, - [], - { + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + returnValue: _FakeWidget_0( + this, + Invocation.method(#build, [], { #context: context, #creationParams: creationParams, #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, #javascriptChannelRegistry: javascriptChannelRegistry, #onWebViewPlatformCreated: onWebViewPlatformCreated, #gestureRecognizers: gestureRecognizers, - }, - ), - returnValue: _FakeWidget_0( - this, - Invocation.method( - #build, - [], - { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }, - ), + }), ), ) as _i2.Widget); @override _i9.Future clearCookies() => (super.noSuchMethod( - Invocation.method( - #clearCookies, - [], - ), + Invocation.method(#clearCookies, []), returnValue: _i9.Future.value(false), ) as _i9.Future); } @@ -117,52 +102,30 @@ class MockWebViewPlatformController extends _i1.Mock @override _i9.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), + Invocation.method(#loadFile, [absoluteFilePath]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), + Invocation.method(#loadFlutterAsset, [key]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override - _i9.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i9.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override - _i9.Future loadUrl( - String? url, - Map? headers, - ) => + _i9.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), + Invocation.method(#loadUrl, [url, headers]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @@ -170,10 +133,7 @@ class MockWebViewPlatformController extends _i1.Mock @override _i9.Future loadRequest(_i5.WebViewRequest? request) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [request], - ), + Invocation.method(#loadRequest, [request]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @@ -181,77 +141,53 @@ class MockWebViewPlatformController extends _i1.Mock @override _i9.Future updateSettings(_i5.WebSettings? setting) => (super.noSuchMethod( - Invocation.method( - #updateSettings, - [setting], - ), + Invocation.method(#updateSettings, [setting]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), + Invocation.method(#currentUrl, []), returnValue: _i9.Future.value(), ) as _i9.Future); @override _i9.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i9.Future.value(false), ) as _i9.Future); @override _i9.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i9.Future.value(false), ) as _i9.Future); @override _i9.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), + Invocation.method(#clearCache, []), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @@ -259,25 +195,18 @@ class MockWebViewPlatformController extends _i1.Mock @override _i9.Future evaluateJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method( - #evaluateJavascript, - [javascript], - ), - returnValue: _i9.Future.value(_i11.dummyValue( - this, - Invocation.method( - #evaluateJavascript, - [javascript], + Invocation.method(#evaluateJavascript, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#evaluateJavascript, [javascript]), ), - )), + ), ) as _i9.Future); @override _i9.Future runJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method( - #runJavascript, - [javascript], - ), + Invocation.method(#runJavascript, [javascript]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @@ -285,100 +214,64 @@ class MockWebViewPlatformController extends _i1.Mock @override _i9.Future runJavascriptReturningResult(String? javascript) => (super.noSuchMethod( - Invocation.method( - #runJavascriptReturningResult, - [javascript], - ), - returnValue: _i9.Future.value(_i11.dummyValue( - this, - Invocation.method( - #runJavascriptReturningResult, - [javascript], + Invocation.method(#runJavascriptReturningResult, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#runJavascriptReturningResult, [javascript]), ), - )), + ), ) as _i9.Future); @override _i9.Future addJavascriptChannels(Set? javascriptChannelNames) => (super.noSuchMethod( - Invocation.method( - #addJavascriptChannels, - [javascriptChannelNames], - ), + Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future removeJavascriptChannels( - Set? javascriptChannelNames) => + Set? javascriptChannelNames, + ) => (super.noSuchMethod( - Invocation.method( - #removeJavascriptChannels, - [javascriptChannelNames], - ), + Invocation.method(#removeJavascriptChannels, [ + javascriptChannelNames, + ]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i9.Future.value(), ) as _i9.Future); @override - _i9.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i9.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override - _i9.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i9.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i9.Future.value(), returnValueForMissingStub: _i9.Future.value(), ) as _i9.Future); @override _i9.Future getScrollX() => (super.noSuchMethod( - Invocation.method( - #getScrollX, - [], - ), + Invocation.method(#getScrollX, []), returnValue: _i9.Future.value(0), ) as _i9.Future); @override _i9.Future getScrollY() => (super.noSuchMethod( - Invocation.method( - #getScrollY, - [], - ), + Invocation.method(#getScrollY, []), returnValue: _i9.Future.value(0), ) as _i9.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index 883191779cc..4b02c37ace2 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter/test/navigation_delegate_test.dart. // Do not manually edit this file. @@ -26,6 +26,7 @@ import 'package:webview_flutter_platform_interface/src/webview_platform.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -36,43 +37,25 @@ class _FakePlatformWebViewCookieManager_0 extends _i1.SmartFake _FakePlatformWebViewCookieManager_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePlatformNavigationDelegate_1 extends _i1.SmartFake implements _i3.PlatformNavigationDelegate { - _FakePlatformNavigationDelegate_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformNavigationDelegate_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewController_2 extends _i1.SmartFake implements _i4.PlatformWebViewController { - _FakePlatformWebViewController_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewController_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewWidget_3 extends _i1.SmartFake implements _i5.PlatformWebViewWidget { - _FakePlatformWebViewWidget_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewWidget_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake @@ -80,10 +63,7 @@ class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_4( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [WebViewPlatform]. @@ -96,69 +76,49 @@ class MockWebViewPlatform extends _i1.Mock implements _i7.WebViewPlatform { @override _i2.PlatformWebViewCookieManager createPlatformCookieManager( - _i6.PlatformWebViewCookieManagerCreationParams? params) => + _i6.PlatformWebViewCookieManagerCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformCookieManager, - [params], - ), + Invocation.method(#createPlatformCookieManager, [params]), returnValue: _FakePlatformWebViewCookieManager_0( this, - Invocation.method( - #createPlatformCookieManager, - [params], - ), + Invocation.method(#createPlatformCookieManager, [params]), ), ) as _i2.PlatformWebViewCookieManager); @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( - _i6.PlatformNavigationDelegateCreationParams? params) => + _i6.PlatformNavigationDelegateCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformNavigationDelegate, - [params], - ), + Invocation.method(#createPlatformNavigationDelegate, [params]), returnValue: _FakePlatformNavigationDelegate_1( this, - Invocation.method( - #createPlatformNavigationDelegate, - [params], - ), + Invocation.method(#createPlatformNavigationDelegate, [params]), ), ) as _i3.PlatformNavigationDelegate); @override _i4.PlatformWebViewController createPlatformWebViewController( - _i6.PlatformWebViewControllerCreationParams? params) => + _i6.PlatformWebViewControllerCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformWebViewController, - [params], - ), + Invocation.method(#createPlatformWebViewController, [params]), returnValue: _FakePlatformWebViewController_2( this, - Invocation.method( - #createPlatformWebViewController, - [params], - ), + Invocation.method(#createPlatformWebViewController, [params]), ), ) as _i4.PlatformWebViewController); @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( - _i6.PlatformWebViewWidgetCreationParams? params) => + _i6.PlatformWebViewWidgetCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformWebViewWidget, - [params], - ), + Invocation.method(#createPlatformWebViewWidget, [params]), returnValue: _FakePlatformWebViewWidget_3( this, - Invocation.method( - #createPlatformWebViewWidget, - [params], - ), + Invocation.method(#createPlatformWebViewWidget, [params]), ), ) as _i5.PlatformWebViewWidget); } @@ -184,12 +144,10 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnNavigationRequest( - _i3.NavigationRequestCallback? onNavigationRequest) => + _i3.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -197,10 +155,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), + Invocation.method(#setOnPageStarted, [onPageStarted]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -208,10 +163,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), + Invocation.method(#setOnPageFinished, [onPageFinished]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -219,10 +171,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), + Invocation.method(#setOnHttpError, [onHttpError]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -230,22 +179,17 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), + Invocation.method(#setOnProgress, [onProgress]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnWebResourceError( - _i3.WebResourceErrorCallback? onWebResourceError) => + _i3.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), + Invocation.method(#setOnWebResourceError, [onWebResourceError]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -253,22 +197,17 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), + Invocation.method(#setOnUrlChange, [onUrlChange]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( - _i3.HttpAuthRequestCallback? onHttpAuthRequest) => + _i3.HttpAuthRequestCallback? onHttpAuthRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart index 6cae01a4941..f0310415a85 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart @@ -492,6 +492,22 @@ void main() { .setOnScrollPositionChange(onScrollPositionChange), ); }); + + test('setOverScrollMode', () async { + final MockPlatformWebViewController mockPlatformWebViewController = + MockPlatformWebViewController(); + + final WebViewController webViewController = WebViewController.fromPlatform( + mockPlatformWebViewController, + ); + + await webViewController.setOverScrollMode(WebViewOverScrollMode.never); + verify( + mockPlatformWebViewController.setOverScrollMode( + WebViewOverScrollMode.never, + ), + ); + }); } class TestPlatformWebViewPermissionRequest diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 981e7386ac0..0c4537103a5 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter/test/webview_controller_test.dart. // Do not manually edit this file. @@ -21,6 +21,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -31,30 +32,17 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_1 extends _i1.SmartFake implements Object { - _FakeObject_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { - _FakeOffset_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -62,10 +50,7 @@ class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [PlatformWebViewController]. @@ -88,35 +73,22 @@ class MockPlatformWebViewController extends _i1.Mock @override _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), + Invocation.method(#loadFile, [absoluteFilePath]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), + Invocation.method(#loadFlutterAsset, [key]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -124,109 +96,77 @@ class MockPlatformWebViewController extends _i1.Mock @override _i5.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), + Invocation.method(#loadRequest, [params]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), + Invocation.method(#currentUrl, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), + Invocation.method(#clearCache, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), + Invocation.method(#clearLocalStorage, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( - _i6.PlatformNavigationDelegate? handler) => + _i6.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), + Invocation.method(#setPlatformNavigationDelegate, [handler]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), + Invocation.method(#runJavaScript, [javaScript]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -234,27 +174,21 @@ class MockPlatformWebViewController extends _i1.Mock @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i5.Future.value(_FakeObject_1( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), ), - )), + ), ) as _i5.Future); @override _i5.Future addJavaScriptChannel( - _i4.JavaScriptChannelParams? javaScriptChannelParams) => + _i4.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -262,88 +196,51 @@ class MockPlatformWebViewController extends _i1.Mock @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), ), - returnValue: _i5.Future<_i3.Offset>.value(_FakeOffset_2( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), ) as _i5.Future<_i3.Offset>); @override _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), + Invocation.method(#enableZoom, [enabled]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -351,105 +248,101 @@ class MockPlatformWebViewController extends _i1.Mock @override _i5.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), + Invocation.method(#setJavaScriptMode, [javaScriptMode]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), + Invocation.method(#setUserAgent, [userAgent]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( - void Function(_i2.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), + Invocation.method(#getUserAgent, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnConsoleMessage( - void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( - void Function(_i2.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i2.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( - _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( - _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( - _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => + _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => + (super.noSuchMethod( + Invocation.method(#setOverScrollMode, [mode]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -476,12 +369,10 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnNavigationRequest( - _i6.NavigationRequestCallback? onNavigationRequest) => + _i6.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -489,10 +380,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnPageStarted(_i6.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), + Invocation.method(#setOnPageStarted, [onPageStarted]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -500,10 +388,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnPageFinished(_i6.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), + Invocation.method(#setOnPageFinished, [onPageFinished]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -511,10 +396,7 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnHttpError(_i6.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), + Invocation.method(#setOnHttpError, [onHttpError]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -522,22 +404,17 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnProgress(_i6.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), + Invocation.method(#setOnProgress, [onProgress]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnWebResourceError( - _i6.WebResourceErrorCallback? onWebResourceError) => + _i6.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), + Invocation.method(#setOnWebResourceError, [onWebResourceError]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -545,22 +422,17 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i5.Future setOnUrlChange(_i6.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), + Invocation.method(#setOnUrlChange, [onUrlChange]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnHttpAuthRequest( - _i6.HttpAuthRequestCallback? onHttpAuthRequest) => + _i6.HttpAuthRequestCallback? onHttpAuthRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); diff --git a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart index 20bf87f4dca..31b11889cb7 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter/test/webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -18,6 +18,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -28,10 +29,7 @@ class _FakePlatformWebViewCookieManagerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewCookieManagerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [PlatformWebViewCookieManager]. @@ -55,19 +53,13 @@ class MockPlatformWebViewCookieManager extends _i1.Mock @override _i4.Future clearCookies() => (super.noSuchMethod( - Invocation.method( - #clearCookies, - [], - ), + Invocation.method(#clearCookies, []), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future setCookie(_i2.WebViewCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], - ), + Invocation.method(#setCookie, [cookie]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); diff --git a/packages/webview_flutter/webview_flutter/test/webview_flutter_export_test.dart b/packages/webview_flutter/webview_flutter/test/webview_flutter_export_test.dart index 907cc474cc8..b404fce0020 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_flutter_export_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_flutter_export_test.dart @@ -30,6 +30,7 @@ void main() { main_file.PlatformWebViewPermissionRequest; main_file.PlatformWebViewWidgetCreationParams; main_file.ProgressCallback; + main_file.WebViewOverScrollMode; main_file.WebViewPermissionResourceType; main_file.WebResourceError; main_file.WebResourceErrorCallback; diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index ec6bd85e095..69e0c449c6d 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter/test/webview_widget_test.dart. // Do not manually edit this file. @@ -25,6 +25,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -35,30 +36,17 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_1 extends _i1.SmartFake implements Object { - _FakeObject_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { - _FakeOffset_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake @@ -66,20 +54,12 @@ class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake _FakePlatformWebViewWidgetCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeWidget_4 extends _i1.SmartFake implements _i4.Widget { - _FakeWidget_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWidget_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); @override String toString({_i5.DiagnosticLevel? minLevel = _i5.DiagnosticLevel.info}) => @@ -106,35 +86,22 @@ class MockPlatformWebViewController extends _i1.Mock @override _i7.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), + Invocation.method(#loadFile, [absoluteFilePath]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), + Invocation.method(#loadFlutterAsset, [key]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override - _i7.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i7.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @@ -142,109 +109,77 @@ class MockPlatformWebViewController extends _i1.Mock @override _i7.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), + Invocation.method(#loadRequest, [params]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), + Invocation.method(#currentUrl, []), returnValue: _i7.Future.value(), ) as _i7.Future); @override _i7.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i7.Future.value(false), ) as _i7.Future); @override _i7.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i7.Future.value(false), ) as _i7.Future); @override _i7.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), + Invocation.method(#clearCache, []), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), + Invocation.method(#clearLocalStorage, []), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setPlatformNavigationDelegate( - _i8.PlatformNavigationDelegate? handler) => + _i8.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), + Invocation.method(#setPlatformNavigationDelegate, [handler]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), + Invocation.method(#runJavaScript, [javaScript]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @@ -252,27 +187,21 @@ class MockPlatformWebViewController extends _i1.Mock @override _i7.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i7.Future.value(_FakeObject_1( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i7.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), ), - )), + ), ) as _i7.Future); @override _i7.Future addJavaScriptChannel( - _i6.JavaScriptChannelParams? javaScriptChannelParams) => + _i6.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @@ -280,88 +209,51 @@ class MockPlatformWebViewController extends _i1.Mock @override _i7.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i7.Future.value(), ) as _i7.Future); @override - _i7.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i7.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override - _i7.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i7.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i7.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), ), - returnValue: _i7.Future<_i3.Offset>.value(_FakeOffset_2( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), ) as _i7.Future<_i3.Offset>); @override _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), + Invocation.method(#enableZoom, [enabled]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @@ -369,105 +261,101 @@ class MockPlatformWebViewController extends _i1.Mock @override _i7.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), + Invocation.method(#setJavaScriptMode, [javaScriptMode]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), + Invocation.method(#setUserAgent, [userAgent]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnPlatformPermissionRequest( - void Function(_i2.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), + Invocation.method(#getUserAgent, []), returnValue: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnConsoleMessage( - void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnScrollPositionChange( - void Function(_i2.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i2.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnJavaScriptAlertDialog( - _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnJavaScriptConfirmDialog( - _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @override _i7.Future setOnJavaScriptTextInputDialog( - _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => + _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + + @override + _i7.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => + (super.noSuchMethod( + Invocation.method(#setOverScrollMode, [mode]), returnValue: _i7.Future.value(), returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); @@ -493,16 +381,10 @@ class MockPlatformWebViewWidget extends _i1.Mock @override _i4.Widget build(_i4.BuildContext? context) => (super.noSuchMethod( - Invocation.method( - #build, - [context], - ), + Invocation.method(#build, [context]), returnValue: _FakeWidget_4( this, - Invocation.method( - #build, - [context], - ), + Invocation.method(#build, [context]), ), ) as _i4.Widget); }