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 a component loses focus generally.
finalinherited
onChange → void Function(Event e)?
Callback invoked when an input component's value change is committed (e.g. on blur/submit).
finalinherited
onClick → void Function(Event e)?
Callback invoked when a component is clicked or tapped.
finalinherited
onDoubleClick → void Function(MouseEvent e)?
Callback invoked when a component is double-clicked or double-tapped.
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 a component gains focus generally.
finalinherited
onFocusIn → void Function(FocusEvent e)?
Callback invoked when a component or its descendant gains focus.
finalinherited
onFocusOut → void Function(FocusEvent e)?
Callback invoked when a component or its descendant loses focus.
finalinherited
onInput → void Function(Event e)?
Callback invoked when an input component'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 keyboard key is pressed down.
finalinherited
onKeyUp → void Function(KeyboardEvent e)?
Callback invoked when a keyboard key is released after being pressed.
finalinherited
onLongPress → void Function(PointerEvent e)?
Callback invoked when a component is clicked or tapped and 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 is on a component.
finalinherited
onMouseLeave → void Function(MouseEvent e)?
Callback invoked when the mouse cursor is no longer on a component.
finalinherited
onMouseMove → void Function(MouseEvent e)?
Callback invoked when the mouse cursor moves across a component.
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 a component.
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 a component boundaries.
finalinherited
onPointerLeave → void Function(PointerEvent e)?
Callback invoked when a pointer leaves a component boundaries.
finalinherited
onPointerMove → void Function(PointerEvent e)?
Callback invoked when a pointer moves across a component.
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 in an input component.
finalinherited
onSubmit → void Function(Event e)?
Callback invoked when a 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