web_browser 0.6.1 web_browser: ^0.6.1 copied to clipboard
A cross-platform Flutter widget for displaying websites and other web content. Has navigation Cupertino/Material buttons and takes care of complex platform differences.
Overview #
Browser is a Flutter widget for browsing websites.
- Works in Android, iOS, and browsers. Various cross-platform differences are handled correctly by the package so you don't need to deal with details of webview_flutter.
- Has a customizable top bar that displays URI. To protect end-users against phishing attacks, we show the domain clearly and nothing else.
- Has customizable bottom bar with buttons for "back", "forward", "refresh", and URL sharing.
Licensed under the Apache License 2.0.
Links #
Setting up #
1.Setup #
In pubspec.yaml:
dependencies:
web_browser: ^0.6.0
2.Display web browser #
import 'package:flutter/material.dart';
import 'package:web_browser/web_browser.dart';
void main() {
runApp(const MaterialApp(
home: Scaffold(
body: SafeArea(
child: WebBrowser(
initialUriString: 'https://flutter.dev/',
),
),
),
));
}
Manual #
Designs available in this package #
The package contains two designs:
By default, the package chooses a Cupertino or Material design based on whether the app is CupertinoApp or MaterialApp.
| | |
Localization #
Use BrowserLocalizations to localize the widgets.