MockStreamHandler class abstract
A mock stream handler for an EventChannel that mimics the native StreamHandler API.
The onListen callback is provided a MockStreamHandlerEventSink with the following API:
- MockStreamHandlerEventSink.success sends a success event.
- MockStreamHandlerEventSink.error sends an error event.
- MockStreamHandlerEventSink.endOfStream sends an end of stream event.
Constructors
- MockStreamHandler()
-
Create a new MockStreamHandler.
const
- MockStreamHandler.inline({required MockStreamHandlerOnListenCallback onListen, MockStreamHandlerOnCancelCallback? onCancel})
-
Create a new inline MockStreamHandler with the given
onListen
andonCancel
handlers.constfactory
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCancel(
Object? arguments) → void - Handler for the cancel event.
-
onListen(
Object? arguments, MockStreamHandlerEventSink events) → void - Handler for the listen event.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited