From 4019e7fb781ce4f91114a725fc594f970c7986d0 Mon Sep 17 00:00:00 2001 From: DASHU <385321165@qq.com> Date: Tue, 21 Jan 2025 22:17:36 +0800 Subject: [PATCH] webview bugfix --- lib/component/webview/webview_component.dart | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/component/webview/webview_component.dart b/lib/component/webview/webview_component.dart index 0775262..760b66e 100644 --- a/lib/component/webview/webview_component.dart +++ b/lib/component/webview/webview_component.dart @@ -64,33 +64,33 @@ class _WebViewComponent extends State void initState() { super.initState(); - // contextMenu = ContextMenu( - // menuItems: [ - // ContextMenuItem( - // id: 1, - // title: "Special", - // action: () async { - // print("Menu item Special clicked!"); - // print(await webViewController?.getSelectedText()); - // await webViewController?.clearFocus(); - // }) - // ], - // settings: ContextMenuSettings(hideDefaultSystemContextMenuItems: false), - // onCreateContextMenu: (hitTestResult) async { - // print("onCreateContextMenu"); - // print(hitTestResult.extra); - // print(await webViewController?.getSelectedText()); - // }, - // onHideContextMenu: () { - // print("onHideContextMenu"); - // }, - // onContextMenuActionItemClicked: (contextMenuItemClicked) async { - // var id = contextMenuItemClicked.id; - // print("onContextMenuActionItemClicked: " + - // id.toString() + - // " " + - // contextMenuItemClicked.title); - // }); + contextMenu = ContextMenu( + menuItems: [ + ContextMenuItem( + id: 1, + title: "Special", + action: () async { + print("Menu item Special clicked!"); + print(await webViewController?.getSelectedText()); + await webViewController?.clearFocus(); + }) + ], + settings: ContextMenuSettings(hideDefaultSystemContextMenuItems: false), + onCreateContextMenu: (hitTestResult) async { + print("onCreateContextMenu"); + print(hitTestResult.extra); + print(await webViewController?.getSelectedText()); + }, + onHideContextMenu: () { + print("onHideContextMenu"); + }, + onContextMenuActionItemClicked: (contextMenuItemClicked) async { + var id = contextMenuItemClicked.id; + print("onContextMenuActionItemClicked: " + + id.toString() + + " " + + contextMenuItemClicked.title); + }); pullToRefreshController = kIsWeb || ![TargetPlatform.iOS, TargetPlatform.android]