fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 929 forks source link

The listener onUrlChanged did not trigger #848

Open chinafelix opened 3 years ago

chinafelix commented 3 years ago
  1. In the webview plugin, the route jump between h5 did not trigger onUrlChange.
  2. for example, just jumps to its sub-route

    void initState() {
    super.initState();
    flutterWebviewPlugin.close();
    _stateListener = flutterWebviewPlugin.onStateChanged.listen((viewState) async {
      if (viewState.type == WebViewState.finishLoad) {
        print('xxx');
      }
    });
    
    _urlListener = **flutterWebviewPlugin.onUrlChanged.listen**((String url) {
      // here, can not been trigger where roure change
      if(mounted) {
      }
    });
    }
Shvet commented 1 year ago

did you find solution?