GetStateExtension<A, S> extension

Get current state synchronously. This is useful for filling initialData when using StreamBuilder in Flutter.

Example:

StreamBuilder<LoginState>(
  initialData: store.state,
  stream: store.stateStream,
  builder: (context, snapshot) {
    final state = snapshot.data;
    return LoginWidget(state); // build widget based on state.
  },
);
on

Properties

state → S
Get current state synchronously. This is useful for filling initialData when using StreamBuilder in Flutter.
no setter