EventStreamProvider<T extends Event> class
Helper class used to create streams abstracting DOM events. This is a
piece of the helper layer directly derived from a similar feature in
dart:html.
A few differences compared to dart:html:
-
The helper layer doesn't have
ElementListAPIs, so this provider omits APIs related to them. -
Streams returned here behave slighly differently. The timing of when callbacks execute is sometimes different when using stream to future APIs like
.first. In particular, when using synchronous browser APIs likedispatchEvent, the Dart callbacks that would have executed synchronously indart:html, may now execute asynchronously. This only breaks code that relied on specific timing details of the implementation, but at an API level, the change is non breaking.
Constructors
- EventStreamProvider(String _eventType)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
forElement(
Element e, {bool useCapture = false}) → ElementStream< T> - Gets a Stream for this event type, on the specified element.
-
forTarget(
EventTarget? e, {bool useCapture = false}) → Stream< T> - Gets a Stream for this event type, on the specified target.
-
getEventType(
EventTarget target) → String - Gets the type of the event which this would listen for on the specified event target.
-
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