InputEvents class

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!'),
);
Inheritance

Constructors

InputEvents({void onInput(Event e)?, void onChange(Event e)?, void onSelect(Event e)?, void onFocus(FocusEvent e)?, void onFocusIn(FocusEvent e)?, void onFocusOut(FocusEvent e)?, void onBlur(FocusEvent e)?, void onInvalid(Event e)?, void onKeyDown(KeyboardEvent e)?, void onKeyUp(KeyboardEvent e)?, void onPaste(ClipboardEvent e)?, 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.

Properties

customEvents → Map<String, void Function(Event)>?
Add custom events to the event recognizer.
final
hashCode → int
The hash code for this object.
no setterinherited
longPressDuration → Duration
Duration threshold required to trigger onLongPress (default: 500ms).
finalinherited
onBlur → void Function(FocusEvent e)?
Callback invoked when the element loses focus.
finalinherited
onChange → void Function(Event e)?
Callback invoked when an input element's value change is committed (e.g. on blur/submit).
finalinherited
onClick → void Function(Event e)?
Callback invoked when a standard click gesture occurs.
finalinherited
onDoubleClick → void Function(MouseEvent e)?
Callback invoked when a double-click gesture occurs.
finalinherited
onDrag → void Function(DragEvent e)?
Callback invoked periodically during an active drag operation.
finalinherited
onDragEnd → void Function(DragEvent e)?
Callback invoked when a drag operation completes or is canceled.
finalinherited
onDragEnter → void Function(DragEvent e)?
Callback invoked when a dragged item enters the drop target.
finalinherited
onDragLeave → void Function(DragEvent e)?
Callback invoked when a dragged item leaves the drop target.
finalinherited
onDragOver → void Function(DragEvent e)?
Callback invoked while a dragged item is over the drop target.
finalinherited
onDragStart → void Function(DragEvent e)?
Callback invoked when a drag operation is initiated.
finalinherited
onFocus → void Function(FocusEvent e)?
Callback invoked when the element gains focus.
finalinherited
onFocusIn → void Function(FocusEvent e)?
Callback invoked when focus moves into the element or any descendant.
finalinherited
onFocusOut → void Function(FocusEvent e)?
Callback invoked when focus moves out of the element or any descendant.
finalinherited
onInput → void Function(Event e)?
Callback invoked when an input element's value changes synchronously (e.g. while typing).
finalinherited
onInvalid → void Function(Event e)?
Callback invoked when the input is invalid.
finalinherited
onKeyDown → void Function(KeyboardEvent e)?
Callback invoked when a key is pressed down.
finalinherited
onKeyUp → void Function(KeyboardEvent e)?
Callback invoked when a key is released.
finalinherited
onLongPress → void Function(PointerEvent e)?
Callback invoked when a pointer is held down for longer than longPressDuration.
finalinherited
onMouseDown → void Function(MouseEvent e)?
Callback invoked when a mouse button is pressed.
finalinherited
onMouseEnter → void Function(MouseEvent e)?
Callback invoked when the mouse cursor enters the element.
finalinherited
onMouseLeave → void Function(MouseEvent e)?
Callback invoked when the mouse cursor leaves the element.
finalinherited
onMouseMove → void Function(MouseEvent e)?
Callback invoked when the mouse cursor moves within the element.
finalinherited
onMouseUp → void Function(MouseEvent e)?
Callback invoked when a mouse button is released.
finalinherited
onPaste → void Function(ClipboardEvent e)?
Callback invoked when a user pastes data into the element.
finalinherited
onPointerCancel → void Function(PointerEvent e)?
Callback invoked when a pointer event is canceled (e.g. system interrupt).
finalinherited
onPointerDown → void Function(PointerEvent e)?
Callback invoked when a pointer device (mouse, touch, pen) presses down.
finalinherited
onPointerEnter → void Function(PointerEvent e)?
Callback invoked when a pointer enters the element boundaries.
finalinherited
onPointerLeave → void Function(PointerEvent e)?
Callback invoked when a pointer leaves the element boundaries.
finalinherited
onPointerMove → void Function(PointerEvent e)?
Callback invoked when a pointer moves across the element.
finalinherited
onPointerOut → void Function(PointerEvent e)?
Callback invoked when a pointer is moved out of the element or its descendants.
finalinherited
onPointerOver → void Function(PointerEvent e)?
Callback invoked when a pointer is moved onto the element or its descendants.
finalinherited
onPointerUp → void Function(PointerEvent e)?
Callback invoked when a pointer device is released.
finalinherited
onSelect → void Function(Event e)?
Callback invoked when the user selects some text (for input/textarea elements).
finalinherited
onSubmit → void Function(Event e)?
Callback invoked when the form is submitted.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toMap → Map<String, void Function(Event)>
Returns only the active event handlers for non-null callbacks.
no setteroverride

Methods

merge(InputEvents? other) → InputEvents
If you have multiple InputEvents, you can merge them using this method.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited