web_browser 0.1.0 web_browser: ^0.1.0 copied to clipboard
Cross-platform web browser and web content widgets for Flutter applications.
Overview #
Web browser and HTML rendering widgets for Flutter application. Licensed under the Apache License 2.0.
Getting started #
Adding dependency #
In pubspec.yaml:
dependencies:
web_browser: any
2.Configure your project #
In ios/Runner/Info.plist, add:
<key>io.flutter.embedded_views_preview</key>
<true />
3.Use widgets #
WebText #
WebText renders non-navigatable HTML in a borderless box.
- In Android/iOS, it uses webview_flutter, which is maintained by Google.
- In browsers, the widget uses
<div>...</div>
.
import 'package:web_browser/web_browser';
const greeting = WebText('<h1 style="color:navy">Hello world!</h1>');
WebNode #
WebNode renders non-navigatable HTML in a borderless box.
- In Android/iOS, it uses webview_flutter, which is maintained by Google.
- In browsers, the widget uses
<div>...</div>
.
import 'package:web_browser/html';
import 'package:web_browser/web_browser';
final element = HeadingElement.h1()..appendText('Hello world!');
final greeting = WebNode(element);
WebBrowser #
WebBrowser renders a navigatable web page.
- In Android/iOS, it uses webview_flutter, which is maintained by Google.
- In browsers, it uses
iframe
.
import 'package:web_browser/web_browser';
const webBrowser = WebBrowser(
initialUrl: 'https://dart.dev/',
javascript: true,
);