WebView in a mobile application allows us to integrate a web page as a part of the app. It comes with all the features for managing history, cookies, HTML5 support and lot more.
Using webview, you can build very cool apps like integrating HTML5 games, show text, audio, video, animation and more in the mobile app. The web page can be loaded from the same application by using a url address. It is the responsibility of a web browser to interpret text and commands that contained in the web page.
In this post, we are going to learn the basic usage of WebView in Flutter application. You will also learn how to use the WebView with progress bar loader widget that will hide when page fully loaded in the application. We going to create a small example for the same. The final output of the example will look like below:
Creating a new Project
1. Create a new project from File ⇒ New Flutter Project with your development IDE.Using webview, you can build very cool apps like integrating HTML5 games, show text, audio, video, animation and more in the mobile app. The web page can be loaded from the same application by using a url address. It is the responsibility of a web browser to interpret text and commands that contained in the web page.
In this post, we are going to learn the basic usage of WebView in Flutter application. You will also learn how to use the WebView with progress bar loader widget that will hide when page fully loaded in the application. We going to create a small example for the same. The final output of the example will look like below:
Creating a new Project
2. Now, add the WebView plugin webview_flutter 0.3.10+3 as a dependency in the pubspec.yaml file. Once you do that, you need to run flutter packages get.
3. After that open main.dart file and edit it. As we have set our theme and change debug banner property of Application.
4. Here, we have progress_hud.dart widget that we used in this example. You can use it in another project of flutter application. To change the state of this widget, you have to update inAsyncCall field. The progress bar will display if you make it true.
If you have followed the article carefully, you can see the app running very smoothly as shown in the above. But if you are facing any problem or you have any quires, please feel free to ask it from the comment section.