html_to_flutter library
Core implementation for Html.
This package exposes Html entrypoint to parse HTML content and convert it
to Flutter widgets.
It is a set of bare minimum classes and interfaces to parse HTML content that supports rudimentary HTML tags and attributes.
It is designed to be extended by other packages to provide more features.
Usage
import 'package:flutter/material.dart';
import 'package:html_to_flutter/html_to_flutter.dart';
void main() {
runApp(
const MaterialApp(
home: Scaffold(
body: Html(data: '<h1>Hello World</h1>'),
),
),
);
}
Classes
- CssColorParser
- A parser that parses CSS color values.
- Html
- This class represents all supported CSS properties by this package.
- HtmlConfig
- This class represents all configurations for parsing HTML.
- HtmlExtension
-
The
HtmlExtensionclass is the base class for all extensions. - ParsedResult
-
ParsedResultrepresents the result of parsing HTML. - Spacing
-
This class represents properties like
margin,padding, etc. - Style
- This class represents all supported CSS properties by this package.
- TagExtension
- Creates an extension for the specified tag.
- Value
- This class represents a spacing value.
Enums
- RenderMode
-
Defines how the children of
Htmlshould be rendered. - SpacingValueUnit
- The unit of a spacing value.
Extensions
-
ValidElementExtension
on List<
Node> - Helper for Node extensions.
Typedefs
- Document = Document
-
Alias for
package:html/dom.dartdom.Document. - HTMLElement = Element
-
Alias for
package:html/dom.dartdom.Element. - HTMLText = Text
-
Alias for
package:html/dom.dartdom.Text. - Node = Node
-
Alias for
package:html/dom.dartdom.Node. - NodeList = NodeList
-
Alias for
package:html/dom.dartdom.NodeList. -
OnLinkTap
= void Function(String? url, [Map<
Object, String> ? attributes, HTMLElement? element]) - Signature for tap event handler.