fluttercommunity / fluttercommunity/flutter_webview_plugin

WebViewState finishLoad calling multiple time

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
bug not enough info
Dominant language
Java
Stars
1.5k
Forks
938
PR merge metrics
No merged PRs in 30d

Description

Based on finish load I want to save this url in database. But finishLoad calling multiple time. Why it's behavior is like this?

my code:

_webviewPlugin.onStateChanged.listen((WebViewStateChanged state) async {
if (mounted) {

if(WebViewState.startLoad == state.type){

setState(() {
isProgress = true;
});

}else if(WebViewState.finishLoad == state.type){
isProgress = false;
await database.saveUser(new History(widget.uri.toString(), "Hello title"));

}
}
});

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the _webviewPlugin.onStateChanged listener and the WebViewState.finishLoad event path shown in the report. Reproduce the repeated finishLoad notifications with the provided database save, then document the event lifecycle and the condition under which the URL should be saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.