createSelectionOverlay method Null safety

void createSelectionOverlay(
  1. {ExtendedRenderEditable? renderObject,
  2. bool showHandles = true}
)

Implementation

void createSelectionOverlay({
  ExtendedRenderEditable? renderObject,
  bool showHandles = true,
}) {
  _selectionOverlay = ExtendedTextSelectionOverlay(
    clipboardStatus: _clipboardStatus,
    context: context,
    value: _value,
    debugRequiredFor: widget,
    toolbarLayerLink: _toolbarLayerLink,
    startHandleLayerLink: _startHandleLayerLink,
    endHandleLayerLink: _endHandleLayerLink,
    renderObject: renderObject ?? renderEditable,
    selectionControls: widget.selectionControls,
    selectionDelegate: this,
    dragStartBehavior: widget.dragStartBehavior,
    onSelectionHandleTapped: widget.onSelectionHandleTapped,
  );
  _selectionOverlay!.handlesVisible = widget.showSelectionHandles;
  _selectionOverlay!.showHandles();

  // To keep the cursor from blinking while it moves, restart the timer here.
  if (_cursorTimer != null) {
    _stopCursorTimer(resetCharTicks: false);
    _startCursorTimer();
  }
}