How to reload webview in Flutter?

前端 未结 2 1643
长情又很酷
长情又很酷 2021-01-06 12:10

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

2条回答
  •  情话喂你
    2021-01-06 12:35

    You can try to use re render all widget. In my case the widget is HomePage. With Naviagator.push method you can refresh all widget.

    floatingActionButton: FloatingActionButton(
              child: Icon(Icons.refresh),
              backgroundColor: Colors.blueAccent,
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => HomePage()),
                );
              }),
    

提交回复
热议问题