I'm trying to reload a WebView page when I click a button on the Appbar, using the webview_flutter package. For that I'm using a WebviewController, but I'm not getting it... When I click on the button, nothing happens. Check the WebViewCrontroller widget:
WebViewController reloadController = WebViewController()..reload();
My Scaffold widget:
return Scaffold(
appBar: AppBar(
title: Text(utf8decoder.convert(widget.title.codeUnits)),
backgroundColor: hexToColor(user!.templateColorPrimary),
actions: [
IconButton(
onPressed: () => reloadController,
icon: const Icon(Icons.refresh),
)
],
),
body: WebViewWidget(controller: widgetController),
);