WxText class

A powerful widget that builds upon the familiar Flutter Text widget, offering additional functionalities for a richer text display experience.

Inheritance
Implementers

Constructors

WxText(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, WxTextVariantBuilder? variant, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create an extended text widget
const
WxText.bodyLarge(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a large body text widget
const
WxText.bodyMedium(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a medium body text widget
const
WxText.bodySmall(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a small body text widget
const
WxText.displayLarge(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a large display text widget
const
WxText.displayMedium(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a medium display text widget
const
WxText.displaySmall(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a small display text widget
const
WxText.from(WxText other, {Key? key, String? text, int? maxLines, TextOverflow? overflow, bool? filterDisabled})
Create an extended text widget from other instance
WxText.headlineLarge(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a large headline text widget
const
WxText.headlineMedium(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a medium headline text widget
const
WxText.headlineSmall(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a small headline text widget
const
WxText.labelLarge(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a large label text widget
const
WxText.labelMedium(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a medium label text widget
const
WxText.labelSmall(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a small label text widget
const
WxText.titleLarge(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a large title text widget
const
WxText.titleMedium(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a medium title text widget
const
WxText.titleSmall(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, int minLines = 0, Color? minLinesDebugColor, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, Color? color, Color? backgroundColor, List<Shadow>? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height})
Create a small title text widget
const

Properties

backgroundColor Color?
Shortcut to style.backgroundColor
final
caseSensitive bool
If filter not empty, then Dart ignores the case of letters when matching. For example, with caseSensitive disable, the regexp pattern a matches both a and A.
finalinherited
color Color?
Shortcut to style.color
final
data String?
The text to display.
no setterinherited
dotAll bool
If filter not empty, then the . pattern will match all characters, including line terminators.
finalinherited
effectiveFilter List<WxTextFilter>
This getter calculates and returns a combined list of WxTextFilter objects representing the actual filters applied to text content.
no setterinherited
filter List<WxTextFilter>
List of WxTextFilter used to filter and control text appearance
finalinherited
filterDisabled bool
Determines whether the text filter is disabled or not
finalinherited
fontFamily String?
Shortcut to style.fontFamily
final
fontSize double?
Shortcut to style.fontSize
final
fontStyle FontStyle?
Shortcut to style.fontStyle
final
fontWeight FontWeight?
Shortcut to style.fontWeight
final
gradient Gradient?
A gradient to use when filling the text. If this is specified, style.color has no effect.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height double?
Shortcut to style.height
final
highlight String?
The text to highlight
finalinherited
highlightOnTap WxTextFilterTap?
Function triggered when a user taps on highlighted text
finalinherited
highlightStyle TextStyle?
The text style of highlighted text
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
letterSpacing double?
Shortcut to style.letterSpacing
final
locale Locale?
Used to select a font when the same Unicode character can be rendered differently, depending on the locale.
finalinherited
maxLines int?
An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow.
finalinherited
minLines int
Defines the minimum number of lines the widget will always display, regardless of the actual text content.
finalinherited
minLinesDebugColor Color?
This property defines the background color used to highlight the area where the minimum number of lines of text will be displayed. It's helpful for visually debugging layouts that rely on a specific number of text lines being shown.
finalinherited
multiLine bool
If filter not empty, then ^ and $ will match the beginning and end of a line, as well as matching beginning and end of the input, respectively.
finalinherited
outlineBehind bool
Whether the outline position is behind the text.
finalinherited
outlineColor Color
The color of the text outline.
finalinherited
outlineOffset Offset
Controls the distance between the text content and its outline in a widget. It accepts an Offset object, which represents a two-dimensional displacement in terms of horizontal (dx) and vertical (dy) distances.
finalinherited
outlineWidth double
The width of the text outline, in logical pixels.
finalinherited
overflow TextOverflow?
How visual overflow should be handled.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionColor Color?
The color to use when painting the selection.
finalinherited
semanticsLabel String?
An alternative semantics label for this text.
finalinherited
shadows List<Shadow>?
Shortcut to style.shadows
final
softWrap bool?
Whether the text should break at soft line breaks.
finalinherited
strutStyle StrutStyle?
The strut style to use. Strut style defines the strut, which sets minimum vertical layout metrics.
finalinherited
style TextStyle?
If non-null, the style to use for this text.
finalinherited
styleFromShortcuts TextStyle
Collected text style from shortcuts
no setter
styleOverridden TextStyle?
If non-null, the style to use for this text.
final
text String
The text to display.
finalinherited
textAlign TextAlign?
How the text should be aligned horizontally.
finalinherited
textBaseline TextBaseline?
Shortcut to style.textBaseline
final
textDirection TextDirection?
The directionality of the text.
finalinherited
textHeightBehavior TextHeightBehavior?
Defines how to apply TextStyle.height over and under text.
finalinherited
textScaleFactor double?
Deprecated. Will be removed in a future version of Flutter. Use textScaler instead.
finalinherited
textScaler TextScaler?
The font scaling strategy to use when laying out and rendering the text.
finalinherited
textSpan InlineSpan?
The text to display as a InlineSpan.
no setterinherited
textWidthBasis TextWidthBasis?
Defines how to measure the width of the rendered text.
finalinherited
unicode bool
If filter not empty, then Dart treats the pattern as a Unicode pattern per the ECMAScript standard.
finalinherited
variant WxTextVariantBuilder?
The variant text style to apply.
final
wordSpacing double?
Shortcut to style.wordSpacing
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
createRegExp(String source) RegExp
Creates and returns a new RegExp object based on the provided source string and optional configuration flags. The source string represents the actual regular expression pattern you want to match against text.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited