HtmlContent class

Renders an HTML string into a DOM element after the component mounts.

This is useful for trusted server-rendered Markdown, CMS content, docs pages, and other HTML fragments that should not be escaped as text.

Inheritance

Constructors

HtmlContent({required String html, String? id, String? selector, String? className, DartStyle? dartStyle, Map<String, Object?> props = const {}, bool trusted = true})
Creates an HTML content mount.

Properties

className String?
Optional class name for the wrapper element.
getter/setter pair
dartStyle DartStyle?
Optional typed style for the wrapper element.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
html String
HTML string to render into the element.
getter/setter pair
id String?
Optional DOM id. If omitted, Flint UI creates a stable component id.
getter/setter pair
props Map<String, Object?>
Extra props for the wrapper element.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selector String?
Optional CSS selector for an existing element to receive the HTML.
getter/setter pair
trusted bool
When true, writes html as HTML. When false, writes it as text content.
getter/setter pair

Methods

attach(void scheduleRender()) → void
Attaches the render scheduler used by setState.
inherited
build() View?
Builds this component's renderable output.
override
didMount() → void
Called after the component is first mounted in the browser.
override
didUpdate() → void
Called after the component updates following a rerender.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setState(FlintStateUpdater update) → void
Applies update and schedules this component to render again.
inherited
toString() String
A string representation of this object.
inherited
updateFrom(covariant HtmlContent next) → void
Receives the next component instance when Flint preserves this instance.
override
willUnmount() → void
Called before the component is removed from the tree.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited