title: How to reload webview in Flutter?
body: <p>In a Flutter app, I would like to reload the Webview page when I press the refresh icon button on the appbar. I am using the official webview_flutter and do not want to use the flutter_webview_plugin as I have a side drawer. Any ideas as to how to refresh the webview page?</p>
  
  <p>I've tried using setState() to rebuild the same page but the app doesn't rebuild itself. I've also tried using navigator.push() but this directs to a fullscreen webview and covers the drawer and appbar.</p>
  
  <pre><code>Widget build(BuildContext context){
  return Scaffold(
    appBar: AppBar(
      title: Text(widget.drawerItems[_selectedDrawerIndex].title, style: TextStyle(
        shadows: &lt;Shadow&gt;[
          Shadow(
            offset: Offset(1.0, 1.0),
            blurRadius: 10.0,
            color: Color(0xff185B1E),
          ),
        ],
        color: Colors.white,
      ),
    ),
      backgroundColor: Color(0xff9ABDFF),
      iconTheme: IconThemeData(color: Colors.white),
      actions: &lt;Widget&gt;[
  
        IconButton(
          icon: Icon(Icons.refresh), 
          color: Colors.white,
          onPressed: () {
            setState((){
              _selectedDrawerIndex = 3;
              //refresh webview here
            });   
          },
        ),
      ]
      body: _getDrawerItemWidget(_selectedDrawerIndex),
      //_getDrawerItemWidget refers to a webview page
    ),
  }
  </code></pre>
  
  <p>Below is my webview widget:</p>
  
  <pre><code>class Web1 extends StatelessWidget{
    @override
  
    Widget build(BuildContext ctxt) {
      return WebView(
          key: UniqueKey(),
          javascriptMode: JavascriptMode.unrestricted,
          initialUrl: 'http://www.google.com',
      );
    }
  }
  </code></pre>