The blog tries to give the best timely information to its readers and do all the efforts in providing high quality information.
Tutorials
Developing a simple browser using Flutter's flutter_webview_plugin (version 0.4.0)
In this tutorial I am going to explain you that how you can create a simple light weight browser for your mobile device and avoid using other browsers that may be storing some of your data. To do so, we will use Flutter framework with flutter_webview_plugin.
Lets go step by step and develop a very simple browser with very minimal user interface and basic functionality.
Step 1:
Make sure you have Flutter properly installed.
Step 2:
Setup a flutter project in your desired directory.
Step 3:
To verify that everything is so far working fine run the project you have created.
Step 4:
Remove all the content from main.dart file and replace it with:
import'package:flutter/material.dart';
import'browser.dart';
voidmain() {
runApp(
MaterialApp(
home: Browser(),
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(),
),
);
}
Step 5:
Create a new file browser.dart inside the lib folder.
Step 6:
Open pubspec.yaml file and add dependency by running command flutter pub add flutter_webview_plugin in project terminal.
Step 7:
Create a stateful widget inside browser.dart file. and initialise following variables:
Inside app bar I've added a textfield for url input, search and reload page buttons. LaunchUrl function contains url validation and loads the website. LaunchUrl function is as follows:
0 Comments