isActive property Null safety

bool isActive

Whether the state is active or not.

Active state means the the state had data at least once.

By default the state starts with isActive=false, and after the first mutation with data the isActive becomes true, and remains in this state until the state is disposed.

Useful if you want to call onWaiting only one time during initialization.

Example refresh fetched list of products using RefreshIndicator:

class App extends StatelessWidget {
 Widget build(BuildContext context) {
   return RefreshIndicator(
     onRefresh: () => products.refresh(),
     child: OnReactive(
       () => products.onOrElse(
         // show a CircularProgressIndicator
         //for the first fetch of products
         onWaiting: !products.isActive ?
                      () => CircularProgressIndicator()
                      : null,
         orElse: (_) {
           return ListView.builder(
             itemCount: products.state.length,
             itemBuilder: (context, index) {
               return Text(products.state[index]);


bool get isActive {
  return _reactiveModelState._snapState.isActive;