web_browser 0.2.0 copy "web_browser: ^0.2.0" to clipboard
web_browser: ^0.2.0 copied to clipboard

outdated

Widgets for showing web pages and web content. Uses webview_flutter in Android/iOS and iframe in browsers.

Pub Package Github Actions CI

Overview #

Web browser and HTML rendering widgets for Flutter application. Licensed under the Apache License 2.0.

In Android and iOS, this package uses webview_flutter, which is maintained by Google. However, webview_flutter works only in Android and iOS. This package works in browsers too by using <iframe> and other HTML elements. The iframe relies on a dart:ui API that is currently undocumented.

For easy cross-platform DOM manipulation, the package also exports package:web_browser/html.dart, which is a cross-platform dart:html taken from universal_html, a sibling project of this package.

The main widgets in this package are:

  • WebBrowser
    • Shows any web page.
    • By default, the widget gives you:
      • Address bar
      • "Share link" button
      • "Back" button
      • "Forward" button
  • WebNode
    • Shows any DOM node. DOM nodes work in Android and iOS too, thanks to universal_html.

Contributing #

  • Pull request are welcome!
  • Please test your changes manually with the example application.

Known issues #

Setting up #

1.Add dependency #

In pubspec.yaml:

dependencies:
  web_browser: ^0.2.0

For iOS support, you should follow the usual webview_flutter instructions, which means adding the following snippet in ios/Runner/Info.plist:

<key>io.flutter.embedded_views_preview</key>
<true />

2. Try it #

import 'package:flutter/material.dart';
import 'package:web_browser/web_browser.dart';

void main() {
  runApp(MaterialApp(
    body: Scaffold(
      body: SafeArea(
        child: WebBrowser(
          initialUrl: 'https://flutter.cn/',
          javascriptEnabled: true,
        ),
      ),
    ),
  ));
}
69
likes
0
pub points
90%
popularity

Publisher

verified publisherdint.dev

Widgets for showing web pages and web content. Uses webview_flutter in Android/iOS and iframe in browsers.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cupertino_icons, flutter, meta, share, universal_html, webview_flutter

More

Packages that depend on web_browser