InputEvents constructor

InputEvents({
  1. void onInput(
    1. Event e
    )?,
  2. void onChange(
    1. Event e
    )?,
  3. void onSelect(
    1. Event e
    )?,
  4. void onFocus(
    1. FocusEvent e
    )?,
  5. void onFocusIn(
    1. FocusEvent e
    )?,
  6. void onFocusOut(
    1. FocusEvent e
    )?,
  7. void onBlur(
    1. FocusEvent e
    )?,
  8. void onInvalid(
    1. Event e
    )?,
  9. void onKeyDown(
    1. KeyboardEvent e
    )?,
  10. void onKeyUp(
    1. KeyboardEvent e
    )?,
  11. void onPaste(
    1. ClipboardEvent e
    )?,
  12. Map<String, void Function(Event)>? customEvents,
})

A helper class that simplifies binding DOM input, change, select, focus, focusin, focusout, and blur events to input components.

Example

final eventsHandler = InputEvents(
  onInput: (e) => print('Input event!'),
  onChange: (e) => print('Change event!'),
  onSelect: (e) => print('Select event!'),
  onFocus: (e) => print('Focus event!'),
  onFocusIn: (e) => print('Focusin event!'),
  onFocusOut: (e) => print('Focusout event!'),
  onBlur: (e) => print('Blur event!'),
  onInvalid: (e) => print('Invalid event!'),
  onPaste: (e) => print('Paste event!'),
);

Implementation

InputEvents({
  super.onInput,
  super.onChange,
  super.onSelect,
  super.onFocus,
  super.onFocusIn,
  super.onFocusOut,
  super.onBlur,
  super.onInvalid,
  super.onKeyDown,
  super.onKeyUp,
  super.onPaste,
  this.customEvents,
});