Skip to content

Commit 494630a

Browse files
committed
fix viewId type
1 parent 4be2af5 commit 494630a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flutter_inappwebview_web/lib/web/js_bridge.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension type JSSize._(JSObject _) implements JSObject {
77
}
88

99
extension type JSWebView._(JSObject _) implements JSObject {
10-
external JSNumber get viewId;
10+
external JSAny get viewId;
1111
external JSString get iframeId;
1212
external HTMLIFrameElement get iframe;
1313
external HTMLDivElement get iframeContainer;
@@ -43,7 +43,7 @@ external FlutterInAppWebViewBridge? get flutterInAppWebView;
4343

4444
extension type FlutterInAppWebViewBridge._(JSObject _) implements JSObject {
4545
external JSObject webViews;
46-
external JSWebView createFlutterInAppWebView(num viewId, HTMLIFrameElement iframe, HTMLDivElement iframeContainer);
46+
external JSWebView createFlutterInAppWebView(JSAny viewId, HTMLIFrameElement iframe, HTMLDivElement iframeContainer);
4747
external JSString getCookieExpirationDate(num timestamp);
4848
/// Allows assigning a function to be callable from `window.flutter_inappwebview.nativeCommunication()`
4949
external JSFunction nativeCommunication;

flutter_inappwebview_web/lib/web/web_platform.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class InAppWebViewFlutterPlugin {
3434
// ignore: unused_local_variable
3535
final headlessManager = HeadlessInAppWebViewManager(messenger: registrar);
3636
flutterInAppWebView?.nativeCommunication = (
37-
(String method, num viewId, [JSArray? args]) => _dartNativeCommunication(method, viewId, args?.toDart).toJS
37+
(String method, JSAny viewId, [JSArray? args]) => _dartNativeCommunication(method, viewId, args?.toDart).toJS
3838
).toJS;
3939
}
4040
}
4141

42-
Future<JSAny?> _dartNativeCommunication(String method, num viewId,
42+
Future<JSAny?> _dartNativeCommunication(String method, dynamic viewId,
4343
[List? args]) async {
4444
if (WebPlatformManager.webViews.containsKey(viewId)) {
4545
var webViewHtmlElement =

0 commit comments

Comments
 (0)