SelectableText class
Selectable text.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SelectableText
Constructors
- SelectableText(String text, {Key? key, bool autofocus = false, double cursorWidth = _kCursorWidth, FocusNode? focusNode, int? maxLines, int? minLines, TextDirection? textDirection, GestureTapCallback? onTap, bool? showCursor = false, StrutStyle? strutStyle, TextStyle? style, bool enabled = true, TextAlign textAlign = TextAlign.start, double? cursorHeight, TextHeightBehavior? textHeightBehavior, TextWidthBasis? textWidthBasis, bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, DragStartBehavior dragStartBehavior = DragStartBehavior.start, SelectionChangedCallback? onSelectionChanged})
-
Creates a selectable text.
const
- SelectableText.rich(TextSpan textSpan, {Key? key, bool autofocus = false, double cursorWidth = _kCursorWidth, FocusNode? focusNode, int? maxLines, int? minLines, TextDirection? textDirection, GestureTapCallback? onTap, bool? showCursor = false, StrutStyle? strutStyle, TextStyle? style, bool enabled = true, TextAlign textAlign = TextAlign.start, double? cursorHeight, bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, TextHeightBehavior? textHeightBehavior, TextWidthBasis? textWidthBasis, DragStartBehavior dragStartBehavior = DragStartBehavior.start, SelectionChangedCallback? onSelectionChanged})
-
const
Properties
- autofocus → bool
-
Whether this text field should focus itself if nothing else is already
focused.
final
- cursorHeight → double?
-
How tall the cursor will be.
final
- cursorWidth → double
-
How thick the cursor will be.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- enabled → bool
-
final
- enableInteractiveSelection → bool
-
Whether to enable user interface affordances for changing the
text selection.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxLines → int?
-
The maximum number of lines to show at one time, wrapping if necessary.
final
- minLines → int?
-
The minimum number of lines to occupy when the content spans fewer lines.
final
- onSelectionChanged → SelectionChangedCallback?
-
Called when the user changes the selection of text (including the cursor
location).
final
- onTap → GestureTapCallback?
-
Called for the first tap in a series of taps.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionControls → TextSelectionControls?
-
Optional delegate for building the text selection handles.
final
- showCursor → bool?
-
Whether to show cursor.
final
- strutStyle → StrutStyle?
-
The strut style used for the vertical layout.
final
- style → TextStyle?
-
final
- text → String?
-
final
- textAlign → TextAlign
-
How the text should be aligned horizontally.
final
- textDirection → TextDirection?
-
The directionality of the text.
final
- textHeightBehavior → TextHeightBehavior?
-
Defines how to apply TextStyle.height over and under text.
final
- textSpan → TextSpan?
-
final
- textWidthBasis → TextWidthBasis?
-
Defines how to measure the width of the rendered text.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SelectableText> -
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