Skip to content

WebViewState finishLoad calling multiple time #196

Open
@yeahia2508

Description

@yeahia2508

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"));

    }
  }
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions