I’m working on a Flutter app for the web, and I need to retrieve the current URL from a WebView. Specifically, I want to get the URL of the page that is being displayed in the WebView at any given time.
Is there a way to achieve this for the web platform in Flutter? I would appreciate any insights or recommendations on how to retrieve the current URL from a WebView, including any methods or techniques that might be helpful.
I tried several packages like webview_flutter_web: ^0.2.3+4 and easy_web_view: ^2.1.0,
none of them seem to meet my requirements.
2
Answers
To retrieve the current URL from a WebView in Flutter for the web platform, you can use the
webviewx
package, which provides more flexibility for web-based applications.solution
Just as simple as
You can checkout
webview_flutter 4.10.0
which is recommended by flutter here.Using –
You can extract the url of the page, user is visiting.