ConnectionState enum Null safety

The state of connection to an asynchronous computation.

The usual flow of state is as follows:

  1. none, maybe with some initial data.
  2. waiting, indicating that the asynchronous operation has begun, typically with the data being null.
  3. active, with data being non-null, and possible changing over time.
  4. done, with data being non-null.

See also:

  • AsyncSnapshot, which augments a connection state with information received from the asynchronous computation.


active → const ConnectionState

Connected to an active asynchronous computation.

For example, a Stream that has returned at least one value, but is not yet done.

const ConnectionState(2)
done → const ConnectionState

Connected to a terminated asynchronous computation.

const ConnectionState(3)
none → const ConnectionState

Not currently connected to any asynchronous computation.

For example, a FutureBuilder whose FutureBuilder.future is null.

const ConnectionState(0)
values → const List<ConnectionState>

A constant List of the values in this enum, in order of their declaration.

const List<ConnectionState>
waiting → const ConnectionState

Connected to an asynchronous computation and awaiting interaction.

const ConnectionState(1)


hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]