Flutter Webview
Flutter Webview
Flutter Webview
Flutter WebView
Flutter WebView widget displays a browser like space to show the webpage specified by URL. So, you can
display a webpage just like another widget in your mobile application.
In this tutorial, we will learn how to use WebView widget in Android Application.
Open pubspec.yaml file, and under dependencies add webview_flutter as shown below.
Step 2: Import webview package
import 'package:webview_flutter/webview_flutter.dart';
WebViewController _controller;
...
WebView(
initialUrl: 'https://www.tutorialkart.com/',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller = webViewController;
},
),
To recreate this example, create a Flutter Application, follow the above steps and replace the main.dart with the
following.
main.dart
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
pubspec.yaml
name: flutter_webview
description: An example Flutter application to demonstrate WebView widget.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
webview_flutter: ^0.3.0
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
Run the application on an Emulator or a physical device, and you should get the following output.
Conclusion
In this Flutter Tutorial, we learned how to create a WebView widget in your Flutter Application.
Flutter Tutorial
✦ Flutter Tutorial
Flutter Widgets
✦ Flutter Text
✦ Flutter TextField
✦ Flutter FlatButton
✦ Flutter RaisedButton
✦ Flutter RaisedButton
✦ Flutter SnackBar
✦ Flutter Switch
✦ Flutter ToggleButtons
✦ Flutter Table
✦ Flutter DataTable
✦ Flutter Tooltip
Flutter Animation
Flutter Packages
Flutter Examples