HtmlTextBuilder class

Converts HTML content to Flutter widgets using native SelectableText.rich. Each block element becomes a SoftHyphenParagraph with highlight support.

Constructors

HtmlTextBuilder({required double fontSize, String? fontFamily, String? fontPackage, required Color textColor, TextAlign textAlign = TextAlign.justify, Color? accentColor, VoidCallback? onTextTap, List<HighlightModel> highlights = const [], void onHighlightChanged()?, void onParagraphTapped(int paragraphStart, int paragraphEnd)?})

Properties

accentColor → Color?
final
fontFamily → String?
final
fontPackage → String?
final
fontSize → double
final
hashCode → int
The hash code for this object.
no setterinherited
highlights → List<HighlightModel>
final
lastBuiltCleanText → String
The clean text built from blocks (same as what _pageOffset tracks).
no setter
onHighlightChanged → void Function()?
final
onParagraphTapped → void Function(int paragraphStart, int paragraphEnd)?
final
onTextTap → void Function()?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textAlign → TextAlign
final
textColor → Color
final

Methods

build(String html) → List<Widget>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

getPageCleanText(String pageHtml) → String