copyWith method

CockpitTextInputRequest copyWith({
  1. String? text,
  2. int? selectionBase,
  3. int? selectionExtent,
  4. int? composingBase,
  5. int? composingExtent,
  6. CockpitTextInputAction? inputAction,
  7. bool? requestFocus,
  8. bool? clearExisting,
  9. bool clearText = false,
  10. bool clearSelectionBase = false,
  11. bool clearSelectionExtent = false,
  12. bool clearComposingBase = false,
  13. bool clearComposingExtent = false,
  14. bool clearInputAction = false,
})

Returns a copy of this CockpitTextInputRequest with supplied fields replaced.

Implementation

CockpitTextInputRequest copyWith({
  String? text,
  int? selectionBase,
  int? selectionExtent,
  int? composingBase,
  int? composingExtent,
  CockpitTextInputAction? inputAction,
  bool? requestFocus,
  bool? clearExisting,
  bool clearText = false,
  bool clearSelectionBase = false,
  bool clearSelectionExtent = false,
  bool clearComposingBase = false,
  bool clearComposingExtent = false,
  bool clearInputAction = false,
}) {
  return CockpitTextInputRequest(
    text: clearText ? null : (text ?? this.text),
    selectionBase: clearSelectionBase
        ? null
        : (selectionBase ?? this.selectionBase),
    selectionExtent: clearSelectionExtent
        ? null
        : (selectionExtent ?? this.selectionExtent),
    composingBase: clearComposingBase
        ? null
        : (composingBase ?? this.composingBase),
    composingExtent: clearComposingExtent
        ? null
        : (composingExtent ?? this.composingExtent),
    inputAction: clearInputAction ? null : (inputAction ?? this.inputAction),
    requestFocus: requestFocus ?? this.requestFocus,
    clearExisting: clearExisting ?? this.clearExisting,
  );
}