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

discontinued
outdated

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 #

In pubspec.yaml:

dependencies:
  universal_html: ^1.2.3
  web_node: ^0.1.2

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.dev">
//     </div>
html.Node exampleDomTree() {
  final h1 = html.HeadingElement.h1();
  h1.appendText('Dart website');

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

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

  return div;
}
2
likes
0
pub points
41%
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

License

unknown (license)

Dependencies

flutter, meta, universal_html, webview_flutter

More

Packages that depend on web_node