combine5<A, B, C, D, E> static method

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

Implementation

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