Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Owner and Founder. Opencart
Top Partners
In this blog, we will discuss how we can achieve Webview in our flutter app. WebViews are mobile components where HTML content is rendered over a browser inside a mobile app. We will use the webview_flutter plugin to show web pages in our app.
webview_flutter is a Flutter plugin. It provides a WebView widget on Android and iOS. WebView widget has the following properties.
onWebViewCreated: This function is invoked once when the web view is created.
initialUrl: The initial URL of the web resource.
javascriptMode: It is used to enable JavaScript in the WebView.
javascriptChannels: The set of JavascriptChannels available to JavaScript code running in the WebView.
navigationDelegate: A delegate function that decides how to handle navigation actions.
onPageStarted: This function is invoked when a page starts loading.
onPageFinished: This function is invoked when a page has finished loading.
onProgress: This function invoked when a page loading started.
debuggingEnabled: It is use to Controls debugging in WebView by doing its value true but the default debuggingEnabled is false.
debuggingEnabled
gestureNavigationEnabled: A Boolean value indicating whether horizontal swipe gestures will trigger back-forward list navigations. Its default value is false.allowsInlineMediaPlayback: Inline playback of HTML5 videos controlled by this property on iOS. Android allows it by default. Its default value is false.zoomEnabled: It indicates whether the WebView should support zooming using its on-screen zoom controls and gestures. Its default value is true.
backgroundColor: The background color of the WebView.
Step-1 -> Firstly, add the webview_flutter dependency in the pubspec.yaml file.
Step– 2 -> Run ‘flutter pub get‘ command.
After this, we are ready to write our code.
main.dart
common_webview.dart
While running the app, you may face issue related to minSdkVersion. To solve this issue, you should correct the value of minSdkVersion in android/app/build.gradle.
The output of the code is –
In this blog, we have read about the WebView in Flutter.
I hope it will help you out in understanding and getting a brief idea about flutter Webview.
Thank you for reading!!
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Josh Arnold
Owner, Shop ATV Escape
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.