Skip to content

Commit

Permalink
onLoad helper for window and document. (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Sep 23, 2024
1 parent 859b166 commit b94d90a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions web/lib/src/helpers/events/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,19 @@ extension WindowEventGetters on Window {
Stream<KeyboardEvent> get onKeyDown =>
EventStreamProviders.keyDownEvent.forTarget(this);

Stream<TouchEvent> get onTouchMove =>
EventStreamProviders.touchMoveEvent.forTarget(this);

Stream<PopStateEvent> get onPopState =>
EventStreamProviders.popStateEvent.forTarget(this);

Stream<KeyboardEvent> get onKeyPress =>
EventStreamProviders.keyPressEvent.forTarget(this);

Stream<Event> get onLoad => EventStreamProviders.loadEvent.forTarget(this);

Stream<MessageEvent> get onMessage =>
EventStreamProviders.messageEvent.forTarget(this);

Stream<PopStateEvent> get onPopState =>
EventStreamProviders.popStateEvent.forTarget(this);

Stream<TouchEvent> get onTouchMove =>
EventStreamProviders.touchMoveEvent.forTarget(this);
}

extension ElementCustomEvents on Element {
Expand All @@ -278,6 +280,8 @@ extension ElementCustomEvents on Element {
}

extension DocumentCustomEvents on Document {
Stream<Event> get onLoad => EventStreamProviders.loadEvent.forTarget(this);

Stream<WheelEvent> get onMouseWheel =>
CustomEventProviders.mouseWheelEvent.forTarget(this);

Expand Down

0 comments on commit b94d90a

Please sign in to comment.