Skip to content

Latest commit

 

History

History
56 lines (48 loc) · 1.76 KB

README.md

File metadata and controls

56 lines (48 loc) · 1.76 KB

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.

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.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,
        ),
      ),
    ),
  ));
}