fluttercommunity / fluttercommunity/flutter_webview_plugin

onStateChanged listener listening only once

Ouverte
#609 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
1.5k
Forks
938
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.