OudsAnnotatedTextBuilder class
A builder used to compose an OudsAnnotatedText for any typography .rich constructor
(OudsDisplayText.rich, OudsHeadingText.rich, OudsBodyText.rich, OudsLabelText.rich),
letting you color only part of the text.
This is the recommended way to color part of a block of text, as it automatically manages the color scoping through a stack: withColor pushes a color resolver before running its callback and pops it once the callback returns, so nested colored blocks are restored correctly.
Use buildOudsAnnotatedText to create an OudsAnnotatedText from a builder block; see its documentation for a usage example.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
append(
String text) → void -
Appends
text, applying the current color resolver if present. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withColor<
R> (Color? colorResolver(BuildContext context), R block()) → R -
Applies
colorResolverto text appended inblock, then restores the previous resolver.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited