QueryBlocConsumer<B extends BlocBase<AsyncQueryResult<T>>, T> constructor

QueryBlocConsumer<B extends BlocBase<AsyncQueryResult<T>>, T>({
  1. Key? key,
  2. B? bloc,
  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,
  9. BlocBuilderCondition<AsyncQueryResult<T>>? buildWhen,
  10. ContextConsumer? idleConsumer,
  11. ValueConsumer<T>? presetConsumer,
  12. ContextConsumer? workingConsumer,
  13. ValueConsumer<Object>? failedConsumer,
  14. ValueConsumer<T>? succeededConsumer,
  15. BlocBuilderCondition<AsyncQueryResult<T>>? listenWhen,
})

Implementation

QueryBlocConsumer({
  Key? key,
  B? bloc,
  Widget? child,
  required TransitionBuilder? idleBuilder,
  ValueWidgetBuilder<T>? presetBuilder,
  required TransitionBuilder workingBuilder,
  required ValueWidgetBuilder<Object> failedBuilder,
  required ValueWidgetBuilder<T> succeededBuilder,
  BlocBuilderCondition<AsyncQueryResult<T>>? buildWhen,
  ContextConsumer? idleConsumer,
  ValueConsumer<T>? presetConsumer,
  ContextConsumer? workingConsumer,
  ValueConsumer<Object>? failedConsumer,
  ValueConsumer<T>? succeededConsumer,
  BlocBuilderCondition<AsyncQueryResult<T>>? listenWhen,
}) : super(
        key: key,
        bloc: bloc,
        builder: (context, result) => QueryResultBuilder<T>(
          result: result,
          child: child,
          idleBuilder: idleBuilder ?? workingBuilder,
          presetBuilder: presetBuilder ?? succeededBuilder,
          workingBuilder: workingBuilder,
          failedBuilder: failedBuilder,
          succeededBuilder: succeededBuilder,
        ),
        buildWhen: buildWhen,
        listener: StatedConsumer((b) => b
          ..unit(OnState<IdleState>(), idleConsumer)
          ..value(OnState<IdleValueState>(), presetConsumer)
          ..unit(OnState.isWorking(), workingConsumer)
          ..error(OnState.isFailed(), failedConsumer)
          ..value(OnState.isSuceeded(), succeededConsumer)),
        listenWhen: listenWhen,
      );