Skip to main content
The Stac Text allows you to build a Flutter Text widget using JSON. To know more about the text widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
dataStringThe text to display.
childrenList<StacTextSpan>The list of text spans to display.
styleStacTextStyleThe style to apply to the text.
copyWithStyleStacCustomTextStyleOptional style overrides applied on top of style.
textAlignStacTextAlignThe alignment of the text.
textDirectionStacTextDirectionThe direction of the text.
softWrapboolWhether the text should break at soft line breaks.
overflowStacTextOverflowHow visual overflow should be handled.
textScaleFactordoubleThe number of font pixels for each logical pixel.
maxLinesintThe maximum number of lines to display.
semanticsLabelStringThe semantics label for the text.
textWidthBasisStacTextWidthBasisThe width basis for the text.
selectionColorStacColorThe color of the text selection.

Example

StacText(
  data: 'Hello, World!',
  style: StacTextStyle(
    color: StacColors.white,
    fontSize: 24.0,
  ),
)