> For the complete documentation index, see [llms.txt](https://triyono.gitbook.io/fluttercheatsheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triyono.gitbook.io/fluttercheatsheet/my-note/alertdialog/webview-url-listener.md).

# WebView url listener

```
flutter_webview_plugin: ^0.3.10+1
```

untuk listener url pada webview

```
@override
void initState() {
  StreamSubscription<String> _onWebViewUrlChanged;
  _onWebViewUrlChanged =
      FlutterWebviewPlugin().onUrlChanged.listen((String url) {
    print(url);
    if (url == 'https://lpmpjambi.id/supervisi/auth/login') {
      flutterWebviewPlugin.hide();
      Navigator.pushReplacement(
        context,
        MaterialPageRoute(builder: (context) => LoginPage()),
      );
    }
  });
  super.initState();
}
```
