updated example!
This commit is contained in:
parent
f5a048cb69
commit
3f8b1591c8
|
@ -26,7 +26,6 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
);
|
);
|
||||||
|
|
||||||
PullToRefreshController? pullToRefreshController;
|
PullToRefreshController? pullToRefreshController;
|
||||||
FindInteractionController? findInteractionController;
|
|
||||||
|
|
||||||
late ContextMenu contextMenu;
|
late ContextMenu contextMenu;
|
||||||
String url = "";
|
String url = "";
|
||||||
|
@ -82,14 +81,6 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
findInteractionController = kIsWeb
|
|
||||||
? null
|
|
||||||
: FindInteractionController(
|
|
||||||
onFindResultReceived: (controller, activeMatchOrdinal, numberOfMatches, isDoneCounting) => {
|
|
||||||
print("$activeMatchOrdinal $numberOfMatches $isDoneCounting")
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -133,7 +124,6 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
initialSettings: settings,
|
initialSettings: settings,
|
||||||
// contextMenu: contextMenu,
|
// contextMenu: contextMenu,
|
||||||
pullToRefreshController: pullToRefreshController,
|
pullToRefreshController: pullToRefreshController,
|
||||||
findInteractionController: findInteractionController,
|
|
||||||
onWebViewCreated: (controller) async {
|
onWebViewCreated: (controller) async {
|
||||||
webViewController = controller;
|
webViewController = controller;
|
||||||
},
|
},
|
||||||
|
@ -179,32 +169,6 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
this.url = url.toString();
|
this.url = url.toString();
|
||||||
urlController.text = this.url;
|
urlController.text = this.url;
|
||||||
});
|
});
|
||||||
await findInteractionController?.findAllAsync(find: "video");
|
|
||||||
// print(await findInteractionController?.getActiveFindSession());
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
// findInteractionController?.clearMatches();
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
findInteractionController?.findNext(forward: true);
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
findInteractionController?.clearMatches();
|
|
||||||
// print(await findInteractionController?.getSearchText());
|
|
||||||
// findInteractionController?.findNext(forward: true);
|
|
||||||
// findInteractionController?.findNext(forward: false);
|
|
||||||
// findInteractionController?.setSearchText("text");
|
|
||||||
// print(await findInteractionController?.getSearchText());
|
|
||||||
// print(await findInteractionController?.isFindNavigatorVisible());
|
|
||||||
// findInteractionController?.updateResultCount();
|
|
||||||
// findInteractionController?.clearMatches();
|
|
||||||
// findInteractionController?.presentFindNavigator();
|
|
||||||
// await Future.delayed(Duration(milliseconds: 500));
|
|
||||||
// findInteractionController?.dismissFindNavigator();
|
|
||||||
// print(await findInteractionController?.isFindNavigatorVisible());
|
|
||||||
},
|
},
|
||||||
onReceivedError: (controller, request, error) {
|
onReceivedError: (controller, request, error) {
|
||||||
pullToRefreshController?.endRefreshing();
|
pullToRefreshController?.endRefreshing();
|
||||||
|
|
Loading…
Reference in New Issue