RenderHtmlWidget class
Renders an HTML string as Flutter widgets.
Wraps HtmlWidget from flutter_widget_from_html with sensible
theme- and screen-util-aware defaults so the output blends with the
rest of ui_framework_kit.
RenderHtmlWidget(
htmlContent: '<p>Hello <b>world</b></p>',
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- RenderHtmlWidget
- Available extensions
Constructors
-
RenderHtmlWidget({Key? key, required String htmlContent, double fontSize = 13.0, FontWeight? fontWeight, Color? textColor, TextAlign textAlign = TextAlign.start, String? fontFamily, double? lineHeight, bool responsive = true, ValueChanged<
String> ? onLinkTap}) -
Creates an HTML renderer.
const
Properties
- defaultHorizontalSpace → SizedBox
-
Available on Widget, provided by the WidgetExtension extension
no setter - defaultVerticalSpace → SizedBox
-
Available on Widget, provided by the WidgetExtension extension
no setter - fontFamily → String?
-
Override the default font family. Falls back to the theme font when
null.
final
- fontSize → double
-
Base font size for body text. When responsive is
true(the default), the value is treated as.spand scales withflutter_screenutil; otherwise it is used as logical pixels.final - fontWeight → FontWeight?
-
Optional weight for body text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- htmlContent → String
-
HTML markup to render. Supports the tag subset documented by
flutter_widget_from_html.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lineHeight → double?
-
Optional uniform line-height for body text.
final
-
onLinkTap
→ ValueChanged<
String> ? -
Called when the user taps a link inside the rendered HTML. When
null, taps launch the URL in the default external handler viaurl_launcher.final - responsive → bool
-
When
true, fontSize is scaled with.sp. Defaults totrue.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textAlign → TextAlign
-
Default text alignment for paragraphs.
final
- textColor → Color?
-
Override the default text color. Falls back to the ambient
DefaultTextStylecolor when null.final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
center(
) → Center -
Available on Widget, provided by the WidgetExtension extension
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
lightGreyBackground(
{required BuildContext context}) → Container -
Available on Widget, provided by the WidgetExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onTap(
GestureTapCallback callback, {VoidCallback? onLongPress}) → InkWell -
Available on Widget, provided by the WidgetExtension extension
-
padAll(
{double? value}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padBottom(
{double? bottom}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padHorizontal(
{double? horizontal}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padLeft(
{double? left}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padRight(
{double? right}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padTop(
{double? top}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padVertical(
{double? vertical}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padZero(
) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
visible(
bool visible, {Widget? defaultWidget}) → Widget -
Available on Widget, provided by the WidgetExtension extension
set visibility
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited