ReadableStreamSource<T> class

An object containing methods and properties that define how the constructed stream instance will behave.

Note: Use Uint8List if you want compatibility with Response or Request.

Annotations
  • @JS()
  • @anonymous

Constructors

ReadableStreamSource.new({dynamic start(ReadableStreamDefaultController<T> controller)?, dynamic pull(ReadableStreamDefaultController<T> controller)?, dynamic cancel(String reason)?, String? type, int? autoAllocateChunkSize})
factory
ReadableStreamSource.fromStream(Stream<T> stream)
Create ReadableStreamSource from Dart Stream.
factory

Properties

autoAllocateChunkSize int?
For byte streams, the developer can set the autoAllocateChunkSize with a positive integer value to turn on the stream's auto-allocation feature. With this is set, the stream implementation will automatically allocate a view buffer of the specified size in ReadableByteStreamController.byobRequest when required.
getter/setter pair
cancel ↔ PromiseOr<void> Function(String reason)?
This method, also defined by the developer, will be called if the app signals that the stream is to be cancelled (e.g. if ReadableStreamInstanceMembers.cancel is called).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
pull ↔ PromiseOr<void> Function(ReadableStreamDefaultController<T> controller)?
This method, also defined by the developer, will be called repeatedly when the stream's internal queue of chunks is not full, up until it reaches its high water mark.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start ↔ PromiseOr<void> Function(ReadableStreamDefaultController<T> controller)?
This is a method, called immediately when the object is constructed. The contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else required to set up the stream functionality.
getter/setter pair
type String?
This property controls what type of readable stream is being dealt with. If it is included with a value set to "bytes", the passed controller object will be a ReadableByteStreamController capable of handling a BYOB (bring your own buffer)/byte stream. If it is not included, the passed controller will be a ReadableStreamDefaultController.
getter/setter pair

Methods

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