SelectableText.rich constructor

const SelectableText.rich(
  1. TextSpan textSpan,
  2. {Key key,
  3. FocusNode focusNode,
  4. TextStyle style,
  5. StrutStyle strutStyle,
  6. TextAlign textAlign,
  7. TextDirection textDirection,
  8. bool showCursor: false,
  9. bool autofocus: false,
  10. ToolbarOptions toolbarOptions,
  11. int maxLines,
  12. double cursorWidth: 2.0,
  13. Radius cursorRadius,
  14. Color cursorColor,
  15. DragStartBehavior dragStartBehavior: DragStartBehavior.start,
  16. bool enableInteractiveSelection: true,
  17. GestureTapCallback onTap,
  18. ScrollPhysics scrollPhysics,
  19. TextWidthBasis textWidthBasis}
)

Creates a selectable text widget with a TextSpan.

The textSpan parameter must not be null and only contain TextSpan in textSpan.children. Other type of InlineSpan is not allowed.

The autofocus and dragStartBehavior arguments must not be null.

Implementation

const SelectableText.rich(
  this.textSpan, {
  Key key,
  this.focusNode,
  this.style,
  this.strutStyle,
  this.textAlign,
  this.textDirection,
  this.showCursor = false,
  this.autofocus = false,
  ToolbarOptions toolbarOptions,
  this.maxLines,
  this.cursorWidth = 2.0,
  this.cursorRadius,
  this.cursorColor,
  this.dragStartBehavior = DragStartBehavior.start,
  this.enableInteractiveSelection = true,
  this.onTap,
  this.scrollPhysics,
  this.textWidthBasis,
}) :  assert(showCursor != null),
  assert(autofocus != null),
  assert(dragStartBehavior != null),
  assert(maxLines == null || maxLines > 0),
  assert(
    textSpan != null,
    'A non-null TextSpan must be provided to a SelectableText.rich widget.',
  ),
  data = null,
  toolbarOptions = toolbarOptions ??
    const ToolbarOptions(
      selectAll: true,
      copy: true,
    ),
  super(key: key);