title: webview_flutter how to add header parameter when url changes
body: <p>I use webview_flutter plugin in my flutter app. How can I add header parameter when url changes and how can I and how can I track url change? That's my code. I tried to do it using a loadurl in navigationDelegate, but it doesn't work. How can I do that? Please, help</p>
  <pre><code>String URL = 'https://...../login-app?authkey=${globals.authkey}&amp;test=1';
    WebViewController _webViewController;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: new AppBar(),
  body: WebView(
          // initialUrl: 'https://...../login-app?authkey=${globals.authkey}',
          javascriptMode: JavascriptMode.unrestricted,
          onWebViewCreated: (WebViewController webViewController) {
            _controller.complete(webViewController);
            webViewController.loadUrl(URL,headers: {&quot;SB-app&quot;: &quot;iphone&quot;},);
          },
          navigationDelegate: (NavigationRequest request) async {
            print('allowing navigation to $request');
            if(request.url.contains('driver/chat') || request.url.contains('driver/on-map') || request.url.contains('driver/passanger-form') || request.url.contains('driver/login')) {
              _webViewController.loadUrl(request.url, headers: {&quot;SB-app&quot;: &quot;iphone&quot;});
            }
            return NavigationDecision.navigate;
          },
          onPageStarted: (String url) async {
            print('Page started loading: $url');
          },
          onPageFinished: (String url) async {
            print('Page finished loading: $url');
          },
  </code></pre>