fluttercommunity / fluttercommunity/flutter_webview_plugin

onStateChanged listener listening only once

オープン
#609 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
1.5k
フォーク
938
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。