markup library
Inline markup rendered as Flutter spans.
Translators write HTML5-shaped tags inside messages
(banner = Try <bold>{ $plan }</bold>!); this barrel maps the
resolved span tree to InlineSpans — FluentText for the widget
form, fluentSpansToInline for manual Text.rich composition.
A separate import because it carries package:html (through the
core's markup barrel); apps without inline markup pay nothing.
Classes
- FluentMarkupSpan
- A markup tag wrapping zero or more child spans.
- FluentSpan
- A piece of a formatted message that may contain inline markup.
- FluentText
-
A localized Text.rich — the
Localizedcomponent of fluent-react, Flutter-shaped. Formats id through the nearest FluentLocalization and renders inline markup via tags / styles. - FluentTextSpan
- A run of plain text in a message.
Extensions
- FluentLocalizationMarkup on FluentLocalization
- Span rendering on FluentLocalization — here (not on the class) so the main entrypoint never carries the HTML parser.
- FluentMarkupFormatting on FluentBundle
- Adds span-tree rendering of inline markup to FluentBundle.
Functions
-
applyRecognizer(
GestureRecognizer recognizer, List< InlineSpan> children) → List<InlineSpan> -
Re-attach
recognizerto every text-bearing span inchildren. -
fluentSpansToInline(
List< FluentSpan> spans, {Map<String, FluentTagBuilder> tags = const {}, Map<String, TextStyle> styles = const {}, void onUnknownTag(FluentMarkupSpan node)?}) → List<InlineSpan> -
Convert a resolved fluent span tree to Flutter InlineSpans —
Mozilla's overlay model meeting
Text.rich. -
parseFluentMarkup(
String resolvedText) → List< FluentSpan> - Parse a resolved Fluent message string into a span tree.
Typedefs
-
FluentTagBuilder
= InlineSpan Function(FluentMarkupSpan node, List<
InlineSpan> children) -
Builds the InlineSpan for one markup tag.
nodecarries the tag name and its attributes (node.attrs['href']for<a href="/help">);childrenare the tag's contents, already converted.