Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
undo changes
  • Loading branch information
bparrishMines committed Apr 13, 2023
commit b33679bcfd9a7a0fcba5ba278c48c3da6ca2280d
Original file line number Diff line number Diff line change
Expand Up @@ -778,30 +778,6 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
instance.doUpdateVisitedHistory!(webViewInstance!, url, isReload);
}
}

@override
void doUpdateVisitedHistory(
int instanceId,
int webViewInstanceId,
String url,
bool isReload,
) {
final WebViewClient? instance = instanceManager
.getInstanceWithWeakReference(instanceId) as WebViewClient?;
final WebView? webViewInstance = instanceManager
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
assert(
instance != null,
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
);
assert(
webViewInstance != null,
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
);
if (instance!.doUpdateVisitedHistory != null) {
instance.doUpdateVisitedHistory!(webViewInstance!, url, isReload);
}
}
}

/// Host api implementation for [DownloadListener].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,18 +796,6 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate {
callback(AndroidUrlChange(url: url, isReload: isReload));
}
},
doUpdateVisitedHistory: (
android_webview.WebView webView,
String url,
bool isReload,
) {
if (weakThis.target?._onUrlChange != null) {
weakThis.target!._onUrlChange!(AndroidUrlChange(
url: url,
isReload: isReload,
));
}
},
);

_downloadListener = (this.params as AndroidNavigationDelegateCreationParams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:math' as _i2;
import 'dart:ui' as _i6;

import 'package:mockito/mockito.dart' as _i1;
import 'package:webview_flutter_platform_interface/src/legacy/types/javascript_channel.dart'
as _i8;
import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart'
as _i9;
import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart'
as _i10;
import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'
as _i7;
as _i8;
import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'
as _i6;
as _i7;
import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart'
as _i10;
as _i11;
import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart' as _i3;
import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i4;

Expand Down Expand Up @@ -205,7 +206,7 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView {
),
) as _i3.UIScrollView);
@override
_i5.Future<void> setBackgroundColor(dynamic color) => (super.noSuchMethod(
_i5.Future<void> setBackgroundColor(_i6.Color? color) => (super.noSuchMethod(
Invocation.method(
#setBackgroundColor,
[color],
Expand All @@ -224,9 +225,9 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView {
) as _i5.Future<void>);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -242,7 +243,7 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView {
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -282,9 +283,9 @@ class MockWKNavigationDelegate extends _i1.Mock
) as _i4.WKNavigationDelegate);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -300,7 +301,7 @@ class MockWKNavigationDelegate extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -348,9 +349,9 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences {
) as _i4.WKPreferences);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -366,7 +367,7 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences {
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -420,9 +421,9 @@ class MockWKScriptMessageHandler extends _i1.Mock
) as _i4.WKScriptMessageHandler);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -438,7 +439,7 @@ class MockWKScriptMessageHandler extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -514,7 +515,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView {
returnValue: _i5.Future<double>.value(0.0),
) as _i5.Future<double>);
@override
_i5.Future<void> loadRequest(_i6.NSUrlRequest? request) =>
_i5.Future<void> loadRequest(_i7.NSUrlRequest? request) =>
(super.noSuchMethod(
Invocation.method(
#loadRequest,
Expand Down Expand Up @@ -654,7 +655,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView {
),
) as _i4.WKWebView);
@override
_i5.Future<void> setBackgroundColor(dynamic color) => (super.noSuchMethod(
_i5.Future<void> setBackgroundColor(_i6.Color? color) => (super.noSuchMethod(
Invocation.method(
#setBackgroundColor,
[color],
Expand All @@ -673,9 +674,9 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView {
) as _i5.Future<void>);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -691,7 +692,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView {
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -776,9 +777,9 @@ class MockWKWebViewConfiguration extends _i1.Mock
) as _i4.WKWebViewConfiguration);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -794,7 +795,7 @@ class MockWKWebViewConfiguration extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -857,9 +858,9 @@ class MockWKWebsiteDataStore extends _i1.Mock
) as _i4.WKWebsiteDataStore);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -875,7 +876,7 @@ class MockWKWebsiteDataStore extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -914,9 +915,9 @@ class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate {
) as _i4.WKUIDelegate);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -932,7 +933,7 @@ class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate {
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -1026,9 +1027,9 @@ class MockWKUserContentController extends _i1.Mock
) as _i4.WKUserContentController);
@override
_i5.Future<void> addObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
required Set<_i6.NSKeyValueObservingOptions>? options,
required Set<_i7.NSKeyValueObservingOptions>? options,
}) =>
(super.noSuchMethod(
Invocation.method(
Expand All @@ -1044,7 +1045,7 @@ class MockWKUserContentController extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> removeObserver(
_i6.NSObject? observer, {
_i7.NSObject? observer, {
required String? keyPath,
}) =>
(super.noSuchMethod(
Expand All @@ -1062,16 +1063,16 @@ class MockWKUserContentController extends _i1.Mock
///
/// See the documentation for Mockito's code generation for more information.
class MockJavascriptChannelRegistry extends _i1.Mock
implements _i7.JavascriptChannelRegistry {
implements _i8.JavascriptChannelRegistry {
MockJavascriptChannelRegistry() {
_i1.throwOnMissingStub(this);
}

@override
Map<String, _i8.JavascriptChannel> get channels => (super.noSuchMethod(
Map<String, _i9.JavascriptChannel> get channels => (super.noSuchMethod(
Invocation.getter(#channels),
returnValue: <String, _i8.JavascriptChannel>{},
) as Map<String, _i8.JavascriptChannel>);
returnValue: <String, _i9.JavascriptChannel>{},
) as Map<String, _i9.JavascriptChannel>);
@override
void onJavascriptChannelMessage(
String? channel,
Expand All @@ -1088,7 +1089,7 @@ class MockJavascriptChannelRegistry extends _i1.Mock
returnValueForMissingStub: null,
);
@override
void updateJavascriptChannelsFromSet(Set<_i8.JavascriptChannel>? channels) =>
void updateJavascriptChannelsFromSet(Set<_i9.JavascriptChannel>? channels) =>
super.noSuchMethod(
Invocation.method(
#updateJavascriptChannelsFromSet,
Expand All @@ -1102,7 +1103,7 @@ class MockJavascriptChannelRegistry extends _i1.Mock
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewPlatformCallbacksHandler extends _i1.Mock
implements _i7.WebViewPlatformCallbacksHandler {
implements _i8.WebViewPlatformCallbacksHandler {
MockWebViewPlatformCallbacksHandler() {
_i1.throwOnMissingStub(this);
}
Expand Down Expand Up @@ -1148,7 +1149,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock
returnValueForMissingStub: null,
);
@override
void onWebResourceError(_i9.WebResourceError? error) => super.noSuchMethod(
void onWebResourceError(_i10.WebResourceError? error) => super.noSuchMethod(
Invocation.method(
#onWebResourceError,
[error],
Expand All @@ -1161,7 +1162,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewWidgetProxy extends _i1.Mock
implements _i10.WebViewWidgetProxy {
implements _i11.WebViewWidgetProxy {
MockWebViewWidgetProxy() {
_i1.throwOnMissingStub(this);
}
Expand All @@ -1171,8 +1172,8 @@ class MockWebViewWidgetProxy extends _i1.Mock
_i4.WKWebViewConfiguration? configuration, {
void Function(
String,
_i6.NSObject,
Map<_i6.NSKeyValueChangeKey, Object?>,
_i7.NSObject,
Map<_i7.NSKeyValueChangeKey, Object?>,
)? observeValue,
}) =>
(super.noSuchMethod(
Expand Down Expand Up @@ -1249,11 +1250,11 @@ class MockWebViewWidgetProxy extends _i1.Mock
)? decidePolicyForNavigationAction,
void Function(
_i4.WKWebView,
_i6.NSError,
_i7.NSError,
)? didFailNavigation,
void Function(
_i4.WKWebView,
_i6.NSError,
_i7.NSError,
)? didFailProvisionalNavigation,
void Function(_i4.WKWebView)? webViewWebContentProcessDidTerminate,
}) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i6;

import 'package:mockito/mockito.dart' as _i1;
import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'
Expand Down Expand Up @@ -255,7 +256,7 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView {
),
) as _i2.WKWebView);
@override
_i4.Future<void> setBackgroundColor(dynamic color) => (super.noSuchMethod(
_i4.Future<void> setBackgroundColor(_i6.Color? color) => (super.noSuchMethod(
Invocation.method(
#setBackgroundColor,
[color],
Expand Down