I'm using the webview_fluttter plugin, but I can't find a way to show a CircularProgressIndicator before the webview shows the page...
What's the equivalent of Androids WebViewClient onPageStarted/onPageFinished?
WebView(
initialUrl: url,
onWebViewCreated: (controller) {
},
)
thank you
In version 0.3.5 there is 'onPageFinished' callback. You can create WebView container with IndexedStack.
Optional parameters hidden and initialChild are available so that you can show something else while waiting for the page to load.If you set hidden to true it will show a default CircularProgressIndicator. If you additionally specify a Widget for initialChild you can have it display whatever you like till page-load.
check this page : flutter_webview_plugin
and you can specify what you want to show with
initialChild
You can work on isLoading and change it after you are sure data is loaded properly.
This is working properly for me
Found the solution.You can add initialChild and set attribute hidden as true.
You can use my plugin flutter_inappwebview, which has a lot of events, methods, and options compared to other plugins, combined with
IndexedStack
and switch between widgets after the WebView is loaded usingonLoadStop
.Full example: