I wanted to perform the following:
- When the Flutter page is loaded, I want the webview (using webview_flutter.dart library) to load 1 second later. After 1 second, the webview would be loaded, and start loading the url website. From the period the Flutter page is loaded until the url has completely loaded the page, I want a circular progress indicator to show the user the app is still running.
Below is the issue that I am facing:
- When the page is loaded, I have a progress indicator running.
- I also have a FutureBuilder to load the webview 1 second later and load an empty Container before 1 second.
- After 1 second later, the FutureBuilder would load the webview and start loading the url.
- After the url is loaded, it will have a callback from the onPageFinished and I called setState() to stop the progress indicator. However, calling setState() will reload the entire page and now the FutureBuilder is retriggers again.
- If I add an "if-else" to prevent the FutureBuilder to load again, then the webview will flickers (even if I use the "key" parameters).
Is it possible to code what I am looking for in Flutter?