TextGroup class

A RichText or SelectableText wrapper with states, including a list of TextGroupItem child, which can be SpanItem, PlainTextItem or LinkTextItem.

Inheritance

Constructors

TextGroup({Key? key, required List<TextGroupItem> texts, required bool? selectable, TextStyle? style, TextSpan outerSpanBuilder(BuildContext context, List<InlineSpan> spans, TextStyle? style)?, int? maxLines, StrutStyle? strutStyle, TextAlign? textAlign = TextAlign.start, TextDirection? textDirection, double? textScaleFactor, TextWidthBasis? textWidthBasis = TextWidthBasis.parent, TextHeightBehavior? textHeightBehavior, bool? softWrap = true, TextOverflow? overflow = TextOverflow.clip, Locale? locale, FocusNode? focusNode, bool? showCursor = false, bool? autofocus = false, bool? enableInteractiveSelection = true, ToolbarOptions? toolbarOptions = const ToolbarOptions(selectAll: true, copy: true), double? cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, DragStartBehavior? dragStartBehavior = DragStartBehavior.start, int? minLines})
Creates a TextGroup which wraps RichText to show TextGroupItem list.
const
TextGroup.normal({Key? key, required List<TextGroupItem> texts, TextStyle? style, TextSpan outerSpanBuilder(BuildContext context, List<InlineSpan> spans, TextStyle? style)?, int? maxLines, StrutStyle? strutStyle, TextAlign? textAlign = TextAlign.start, TextDirection? textDirection, double? textScaleFactor, TextWidthBasis? textWidthBasis = TextWidthBasis.parent, TextHeightBehavior? textHeightBehavior, bool? softWrap = true, TextOverflow? overflow = TextOverflow.clip, Locale? locale})
Creates a TextGroup which wraps RichText to show TextGroupItem list.
const
TextGroup.selectable({Key? key, required List<TextGroupItem> texts, TextStyle? style, TextSpan outerSpanBuilder(BuildContext context, List<InlineSpan> spans, TextStyle? style)?, int? maxLines, StrutStyle? strutStyle, TextAlign? textAlign = TextAlign.start, TextDirection? textDirection, double? textScaleFactor, TextWidthBasis? textWidthBasis = TextWidthBasis.parent, TextHeightBehavior? textHeightBehavior, FocusNode? focusNode, bool? showCursor = false, bool? autofocus = false, bool? enableInteractiveSelection = true, ToolbarOptions? toolbarOptions = const ToolbarOptions(selectAll: true, copy: true), double? cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, DragStartBehavior? dragStartBehavior = DragStartBehavior.start, int? minLines})
Creates a TextGroup which wraps SelectableText to show TextGroupItem list.
const

Properties

autofocus bool?
The autofocus of SelectableText when selectable is true, defaults to false.
final
cursorColor Color?
The cursorColor of SelectableText when selectable is true.
final
cursorHeight double?
The cursorHeight of SelectableText when selectable is true.
final
cursorRadius Radius?
The cursorRadius of SelectableText when selectable is true.
final
cursorWidth double?
The cursorWidth of SelectableText when selectable is true, defaults to 2.0.
final
dragStartBehavior DragStartBehavior?
The dragStartBehavior of SelectableText when selectable is true, defaults to DragStartBehavior.start.
final
enableInteractiveSelection bool?
The enableInteractiveSelection of SelectableText when selectable is true, defaults to true.
final
focusNode FocusNode?
The focusNode of SelectableText when selectable is true.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
The locale of RichText when selectable is false.
final
maxLines int?
The max lines of RichText and SelectableText.
final
minLines int?
The minLines of SelectableText when selectable is true.
final
outerSpanBuilder → (TextSpan Function(BuildContext context, List<InlineSpan> spans, TextStyle? style)?)
The outer TextSpan builder, defaults to add empty TextSpan span list.
final
overflow TextOverflow?
The overflow of RichText when selectable is false, defaults to TextOverflow.clip.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectable bool?
The switcher represents this widget can be selectable, defaults to false.
final
showCursor bool?
The showCursor of SelectableText when selectable is true, defaults to false.
final
softWrap bool?
The softWrap of RichText when selectable is false, defaults to true.
final
strutStyle StrutStyle?
The strutStyle of RichText and SelectableText.
final
style TextStyle?
The text style of the outer TextSpan.
final
textAlign TextAlign?
The textAlign of RichText and SelectableText, defaults to TextAlign.start.
final
textDirection TextDirection?
The textDirection of RichText and SelectableText.
final
textHeightBehavior TextHeightBehavior?
The textHeightBehavior of RichText and SelectableText.
final
texts List<TextGroupItem>
The children of this widget.
final
textScaleFactor double?
The textScaleFactor of RichText and SelectableText, defaults to MediaQuery.of(context).textScaleFactor.
final
textWidthBasis TextWidthBasis?
The textWidthBasis of RichText and SelectableText, defaults to TextWidthBasis.parent.
final
toolbarOptions ToolbarOptions?
The toolbarOptions of SelectableText when selectable is true, defaults to ToolbarOptions(selectAll: true, copy: true).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _TextGroupState
Creates the mutable state for this widget at a given location in the tree.
override
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