combine3<A, B, C> static method

AsyncValueBuilder combine3<A, B, C>(
  1. AsyncValue<A> asyncValue1,
  2. AsyncValue<B> asyncValue2,
  3. AsyncValue<C> asyncValue3, {
  4. required Widget onData(
    1. BuildContext context,
    2. A data1,
    3. B data2,
    4. C data3,
    ),
  5. Widget builder(
    1. BuildContext context,
    2. Widget child,
    3. A? data1,
    4. B? data2,
    5. C? data3,
    )?,
  6. ErrorBuilder? onError,
  7. WidgetBuilder? onLoading,
  8. WidgetBuilder? orElse,
})

Implementation

static AsyncValueBuilder combine3<A, B, C>(
  AsyncValue<A> asyncValue1,
  AsyncValue<B> asyncValue2,
  AsyncValue<C> asyncValue3, {
  required Widget Function(BuildContext context, A data1, B data2, C data3)
      onData,
  Widget Function(
    BuildContext context,
    Widget child,
    A? data1,
    B? data2,
    C? data3,
  )? builder,
  ErrorBuilder? onError,
  WidgetBuilder? onLoading,
  WidgetBuilder? orElse,
}) =>
    AsyncValueBuilder._(
      asyncValues: [asyncValue1, asyncValue2, asyncValue3],
      onData: (context, data) =>
          onData(context, data[0] as A, data[1] as B, data[2] as C),
      builder: (context, child, data) => builder != null
          ? builder.call(
              context,
              child,
              data[0] as A?,
              data[1] as B?,
              data[2] as C?,
            )
          : child,
      onError: onError,
      onLoading: onLoading,
      orElse: orElse,
    );