I'm using webview_flutter.
Is there anyway I can preload a webview widget when the app starts, and reuse the same widget multiple times in the app?
WebView webview = buildWebview();
Widget getWebview() {
return webview;
}
Widget buildWebview() {
return WebView(
key: GlobalKey(),
onWebViewCreated: (WebViewController webViewController) {
print("WebView is Created");
},
...
);
}
This is what I tried, but it seems the WebView is created when the widget is shown on the screen, not when the app starts. And when I call getWebview() again, WebView is created again.