web_browser 0.4.0 web_browser: ^0.4.0 copied to clipboard
A cross-platform Flutter widget for displaying websites and other web content. Has optional navigation buttons.
Overview #
Gives you a cross-platform Flutter widget for displaying websites and other web content.
Licensed under the Apache License 2.0.
Links #
Cross-platform #
WebBrowser widget is cross-platform:
- In Android and iOS, this package uses webview_flutter,
which is maintained by Google.
- However, webview_flutter does not support browsers.
- In browsers, the package uses package:web_node to display web
content inside
<iframe>
.- Only works for websites that allow iframes.
- Only some navigation features are supported (because of iframe limitations).
Optional navigation widgets #
- Address bar
- Share button
- Back button
- Forward button
Setting up #
1.Setup #
In pubspec.yaml:
dependencies:
web_browser: ^0.4.0
2.Display web browser #
import 'package:flutter/material.dart';
import 'package:web_browser/web_browser.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: SafeArea(
child: WebBrowser(
initialUrl: 'https://flutter.dev/',
javascriptEnabled: true,
),
),
),
));
}