web_node 0.1.0 web_node: ^0.1.0 copied to clipboard
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.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:universal_html/html.dart' as html;
import 'package:web_node/web_node.dart';
void main() {
runApp(MaterialApp(
title: 'Example',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
],
home: Scaffold(
body: SafeArea(
child: WebNode(
node: html.DivElement()
..style.textAlign = 'center'
..append(
html.HeadingElement.h1()..appendText('Hello world!'),
)
..append(html.AnchorElement()
..href = 'https://dart.dev/'
..appendText('A link to dart.dev')),
),
),
),
));
}