SharedInputStream class

Shared broadcast input stream wrapper.

Dart's stdin is a single-subscription stream: once listened to, it cannot be listened to again (even if cancelled). This wrapper fans out input into a broadcast stream so TUIs can temporarily stop/restart input listening (e.g. suspend, exec) without triggering "Bad state: Stream has already been listened to".

Important: By design, the underlying source subscription stays alive once started. This enables re-listening within the same process, but it can also keep the Dart event loop alive on real TTYs. Call shutdownSharedStdinStream when the process should be allowed to exit cleanly.

Constructors

SharedInputStream(Stream<List<int>> _source)

Properties

hashCode int
The hash code for this object.
no setterinherited
isShutdown bool
no setter
isStarted bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<List<int>>
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdown() Future<void>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited