WhenRebuilder<T> constructor

const WhenRebuilder<T>({
  1. Key? key,
  2. required Widget onIdle(),
  3. required Widget onWaiting(),
  4. required Widget onError(
    1. dynamic error
    ),
  5. required Widget onData(
    1. T data
    ),
  6. ReactiveModel<T> observe()?,
  7. List<ReactiveModel Function()>? observeMany,
  8. bool shouldRebuild(
    1. ReactiveModel<T>
    )?,
  9. void initState(
    1. BuildContext,
    2. ReactiveModel<T>
    )?,
  10. void dispose(
    1. BuildContext,
    2. ReactiveModel<T>
    )?,
  11. dynamic onSetState(
    1. BuildContext context,
    2. ReactiveModel<T> model
    )?,
  12. void didUpdateWidget(
    1. BuildContext,
    2. ReactiveModel<T>,
    3. WhenRebuilder<T>
    )?,
})

a combination of StateBuilder widget and ReactiveModel.whenConnectionState method. It Exhaustively switch over all the possible statuses of ReactiveModel.connectionState

Implementation

const WhenRebuilder({
  Key? key,
  required this.onIdle,
  required this.onWaiting,
  required this.onError,
  required this.onData,
  this.observe,
  this.observeMany,
  this.shouldRebuild,
  this.initState,
  this.dispose,
  this.onSetState,
  this.didUpdateWidget,
}) : super(key: key);