Skip to main content

Text

Mirai text allows you to build the 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<MiraiTextSpan>The list of text spans to display.
styleMiraiTextStyle?The style to apply to the text.
textAlignTextAlign?The alignment of the text.
textDirectionTextDirection?The direction of the text.
softWrapbool?Whether the text should break at soft line breaks.
overflowTextOverflow?How visual overflow should be handled.
textScaleFactordouble?The number of font pixels for each logical pixel.
maxLinesint?The maximum number of lines to display.
semanticsLabelString?The semantics label for the text.
textWidthBasisTextWidthBasis?The width basis for the text.
selectionColorString?The color of the text selection.

Example JSON​

{
"type": "text",
"data": "Hello, World!",
"style": {
"color": "#FFFFFF",
"fontSize": 24.0
}
}