web_browser 0.5.0
web_browser: ^0.5.0 copied to clipboard

A cross-platform Flutter widget for displaying websites and other web content. Has optional navigation buttons.

Pub Package Github Actions CI

Overview #

Gives you a cross-platform Flutter widget for displaying websites and other web content.

Licensed under the Apache License 2.0.

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.5.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,
        ),
      ),
    ),
  ));
}
26
likes
130
pub points
88%
popularity

Publisher

dint.dev

A cross-platform Flutter widget for displaying websites and other web content. Has optional navigation buttons.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

csp, cupertino_icons, flutter, meta, share, universal_html, web_node, webview_flutter

More

Packages that depend on web_browser