QueryResultBuilder<T> constructor

QueryResultBuilder<T>({
  1. Key? key,
  2. required AsyncQueryResult<T> result,
  3. Widget? child,
  4. required TransitionBuilder? idleBuilder,
  5. ValueWidgetBuilder<T>? presetBuilder,
  6. required TransitionBuilder workingBuilder,
  7. required ValueWidgetBuilder<Object> failedBuilder,
  8. required ValueWidgetBuilder<T> succeededBuilder,
})

Consume AsyncQueryResult

To consume ActionResult, use ActionResultBuilder.sync.

Implementation

QueryResultBuilder({
  Key? key,
  required AsyncQueryResult<T> result,
  Widget? child,
  required TransitionBuilder? idleBuilder,
  ValueWidgetBuilder<T>? presetBuilder,
  required TransitionBuilder workingBuilder,
  required ValueWidgetBuilder<Object> failedBuilder,
  required ValueWidgetBuilder<T> succeededBuilder,
}) : super(
        key: key,
        stated: result,
        child: child,
        patternDefs: (b) => b
          ..unit(
            OnState<IdleState>(),
            idleBuilder ?? workingBuilder,
          )
          ..value(
            OnState<IdleValueState>(),
            presetBuilder ?? succeededBuilder,
          )
          ..unit(OnState.isWorking(), workingBuilder)
          ..error(OnState.isFailed(), failedBuilder)
          ..value(OnState.isSuceeded(), succeededBuilder),
      );