Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use flutterWebviewPlugin.onStateChanged.listen? #210

Closed
lizhuoyuan opened this issue Oct 23, 2018 · 1 comment
Closed

How can I use flutterWebviewPlugin.onStateChanged.listen? #210

lizhuoyuan opened this issue Oct 23, 2018 · 1 comment

Comments

@lizhuoyuan
Copy link

image

@lizhuoyuan
Copy link
Author

lizhuoyuan commented Oct 23, 2018

_onStateChanged =
        flutterWebviewPlugin.onStateChanged.listen((WebViewStateChanged state) {
      if (mounted) {
        switch (state.type) {
          case WebViewState.startLoad:
            setState(() {
              isloading = true;
            });
            break;
          case WebViewState.shouldStart:
            setState(() {
              isloading = true;
            });
            break;
          case WebViewState.finishLoad:
            setState(() {
              isloading = false;
            });
            break;
        }
      }
    });

I did this ,maybe this is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant