Repository: flutter/flutter
File: packages/flutter/test/widgets/editable_text_tester.dart (Dart)

Code before:
  // End of API for TextSelectionGestureDetectorBuilderDelegate.

  @override
  void initState() {
    super.initState();
    _selectionGestureDetectorBuilder = _TestTextFieldSelectionGestureDetectorBuilder(state: this);
  }

  @override
  void dispose() {
    _focusNode?.dispose();
    _controller?.dispose();
    super.dispose();
  }

  static const Color _red = Color(0xFFF44336);

  @override
  Widget build(BuildContext context) {
    return _selectionGestureDetectorBuilder.buildGestureDetector(
      behavior: HitTestBehavior.translucent,
      child: EditableText(
        key: editableTextKey,
        autofillHints: widget.autofillHints,
        autofocus: widget.autofocus,
        backgroundCursorColor: _red, // Colors.red, required by editable text.
        contextMenuBuilder: widget.contextMenuBuilder,
        cursorColor: widget.cursorColor ?? _red, // Colors.red, required by editable text.
        cursorOpacityAnimates: widget.cursorOpacityAnimates,
        focusNode: _effectiveFocusNode, // required by editable text.
        groupId: widget.groupId,
        maxLines: widget.maxLines,
        onChanged: widget.onChanged,
        readOnly: widget.readOnly,
        rendererIgnoresPointer: true, // gestures are provided by text selection gesture detector.
        selectionControls: widget.selectionControls ?? testTextSelectionHandleControls,
        showCursor: widget.showCursor,
        style: widget.style ?? const TextStyle(), // required by editable text.
        controller: _effectiveController, // required by editable text.
      ),
    );
  }
}

class _TestTextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDetectorBuilder {
  _TestTextFieldSelectionGestureDetectorBuilder({required _TestTextFieldState state})
    : super(delegate: state);

  @override
  void onUserTap() {
    // TestTextField does not have an onTap callback.

Review comment (suggestion):
Here and below it as well

```suggestion
        backgroundCursorColor: _red, // required by editable text.
```

Code after:
  // End of API for TextSelectionGestureDetectorBuilderDelegate.

  @override
  void initState() {
    super.initState();
    _selectionGestureDetectorBuilder = _TestTextFieldSelectionGestureDetectorBuilder(state: this);
  }

  @override
  void dispose() {
    _focusNode?.dispose();
    _controller?.dispose();
    super.dispose();
  }

  static const Color _red = Color(0xFFF44336);

  @override
  Widget build(BuildContext context) {
    return _selectionGestureDetectorBuilder.buildGestureDetector(
      behavior: HitTestBehavior.translucent,
      child: EditableText(
        key: editableTextKey,
        autofillHints: widget.autofillHints,
        autofocus: widget.autofocus,
        backgroundCursorColor: _red, // required by editable text.
        contextMenuBuilder: widget.contextMenuBuilder,
        cursorColor: widget.cursorColor ?? _red, // required by editable text.
        cursorOpacityAnimates: widget.cursorOpacityAnimates,
        focusNode: _effectiveFocusNode, // required by editable text.
        groupId: widget.groupId,
        maxLines: widget.maxLines,
        onChanged: widget.onChanged,
        readOnly: widget.readOnly,
        rendererIgnoresPointer: true, // gestures are provided by text selection gesture detector.
        selectionControls: widget.selectionControls ?? testTextSelectionHandleControls,
        showCursor: widget.showCursor,
        style: widget.style ?? const TextStyle(), // required by editable text.
        controller: _effectiveController, // required by editable text.
      ),
    );
  }
}

class _TestTextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDetectorBuilder {
  _TestTextFieldSelectionGestureDetectorBuilder({required _TestTextFieldState state})
    : super(delegate: state);

  @override
  void onUserTap() {
    // TestTextField does not have an onTap callback.