OnlineStatusStream class final Connectivity & lifecycle

The OnlineStatus.stream variant: a starting assumption and a stream of changes.

Usually written as OnlineStatus.stream(changes, initial: …); the class is public so a switch over an OnlineStatus can name it.

Inheritance

Constructors

OnlineStatusStream(Stream<bool> changes, {required bool initial})
Follows changes from initial.
const

Properties

changes → Stream<bool>
Every later change. A broadcast stream always works. A single-subscription one works as long as exactly one provider listens to it exactly once: a provider keeps its one subscription across rebuilds and client switches, but a provider remounted with the same status, two providers given it, or one switched away from it and back each listen again — and a second listen fails with a FlutterError that says so. When in doubt, pass stream.asBroadcastStream().
final
hashCode → int
The hash code for this object.
no setteroverride
initial → bool
What to assume until changes has said anything.
final
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
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override