Skip to Content
Mix 2.0 is in development! You can access the Mix 1.0 docs here.

StyledText

This is equivalent to the Text widget in Flutter.

StyledText( 'Hello World', style: TextStyler() .color(Colors.red) .fontSize(20), );

Constructor

PropTypeRequired / Default Value
textStringRequired
styleStyle<TextSpec>Optional, defaults to TextStyler.create()
keyKey?Optional

Style API Reference

Mix provides an extension of Style<TextSpec> called TextStyler for easily styling StyledText widgets.

MethodDescription
animateSets animation configuration
modifierAdds widget modifiers
overflowSets text overflow behavior (ellipsis, fade, clip)
strutStyleSets strut style for line height and text positioning
textAlignSets text alignment within its bounding box
maxLinesSets maximum number of lines for text
textWidthBasisSets how text width is measured
textHeightBehaviorSets text height adjustment behavior
textDirectionSets text reading direction (LTR/RTL)
softWrapSets whether text should soft-wrap
textScalerSets text scaling factor
selectionColorSets text selection color
semanticsLabelSets semantic label for accessibility
localeSets locale for text display
colorSets text color
fontSizeSets font size
fontWeightSets font weight (boldness)
fontStyleSets font style (italic, normal)
fontFamilySets font family
decorationSets text decoration (underline, line-through)
decorationColorSets decoration color
decorationStyleSets decoration style
backgroundColorSets text background color
heightSets line height multiplier
letterSpacingSets spacing between letters
wordSpacingSets spacing between words
textBaselineSets text baseline alignment
shadowSets single text shadow
shadowsSets multiple text shadows
fontFeaturesSets font features
uppercaseTransforms text to uppercase
lowercaseTransforms text to lowercase
capitalizeCapitalizes first letter of each word
titleCaseConverts text to title case
sentenceCaseCapitalizes first letter of sentences