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.

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

Known issues

Setting up

1.Setup

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(
    home: Scaffold(
      body: SafeArea(
        child: WebBrowser(
          initialUrl: 'https://flutter.dev/',
          javascriptEnabled: true,
        ),
      ),
    ),
  ));
}

Libraries

web_browser
Shows web content in Flutter applications.
web_browser.html
Exports universal_html.