fluttercommunity / fluttercommunity/flutter_webview_plugin
onStateChanged listener listening only once
- Lenguaje dominante
- Java
- Estrellas
- 1.5k
- Forks
- 938
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
flutter_webview_plugin: ^0.3.8
I open the webview when clicking on a button using:
```
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => WebviewScaffold(
url: 'https://google.com',
appBar: AppBar(
title: Text('WebView'),
),
),))
```
In my build method I have
```
flutterWebviewPlugin.onStateChanged.listen(
(WebViewStateChanged viewState) async {
if (viewState.type == WebViewState.finishLoad) {
print('abc');
}
});
```
The onStateChanged works perfectly if I just go from one page to the next but If I hit the back Arrow in the AppBar and again click on the button to open webview, the breakpoint hits 'flutterWebviewPlugin.onStateChanged.listen' line in the build method but it doesn't go inside the onStateChanged.listen function and doesn't print abc.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.