web_node 0.2.1 copy "web_node: ^0.2.1" to clipboard
web_node: ^0.2.1 copied to clipboard

discontinued

A cross-platform widget for displaying DOM nodes (iframes, etc.) in Flutter applications. Uses real DOM nodes in browsers and webview_flutter in Android/iOS.

Pub Package Github Actions CI

Overview #

A cross-platform package for displaying DOM trees in Flutter applications.

If you are looking for a web browser widget (with navigation buttons), try our sibling package web_browser.

Licensed under the Apache License 2.0.

Behavior #

In browsers #

In Android and iOS #

Known issues #

Getting started #

1.Setup #

Your pubspec.yaml should look something like:

environment:
  sdk: ">=2.12.0 <3.0.0"
  flutter: ">=2.0.0"

dependencies:
  universal_html: ^2.0.4
  web_node: ^0.2.1

2.Display DOM nodes #

import 'package:flutter/material.dart';
import 'package:universal_html/html.dart' show html;
import 'package:web_node/web_node.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: SafeArea(
        child: WebNode(node: exampleDomTree()),
      ),
    ),
  ));
}


// Constructs:
//     <div>
//       <h1>Dart website</h1>
//       <iframe src="https://dart.cn">
//     </div>
html.Node exampleDomTree() {
  final h1 = html.HeadingElement.h1();
  h1.appendText('Dart website');

  final iframe = html.IFrameElement();
  iframe.src = 'https://dart.cn/';

  final div = html.DivElement()
  ..append(h1);
  ..append(iframe);

  return div;
}
2
likes
70
pub points
28%
popularity

Publisher

unverified uploader

A cross-platform widget for displaying DOM nodes (iframes, etc.) in Flutter applications. Uses real DOM nodes in browsers and webview_flutter in Android/iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter, meta, universal_html, webview_flutter

More

Packages that depend on web_node