copyWith method

KeyEvent copyWith({
  1. KeyCode? code,
  2. KeyModifiers? modifiers,
  3. KeyEventType? eventType,
})

Creates a copy of this KeyEvent with the given fields replaced.

Implementation

KeyEvent copyWith({
  KeyCode? code,
  KeyModifiers? modifiers,
  KeyEventType? eventType,
}) {
  return KeyEvent(
    code ?? this.code,
    modifiers: modifiers ?? this.modifiers,
    eventType: eventType ?? this.eventType,
  );
}