combine4<A, B, C, D> static method
AsyncBuilder
combine4<A, B, C, D>(
- Future<
A> snapshot1, - Future<
B> snapshot2, - Future<
C> snapshot3, - Future<
D> snapshot4, { - required Widget onData(
- BuildContext context,
- A data1,
- B data2,
- C data3,
- D data4,
- Widget builder(
- BuildContext context,
- Widget child,
- A? data1,
- B? data2,
- C? data3,
- D? data4,
- ErrorBuilder? onError,
- WidgetBuilder? onLoading,
- WidgetBuilder? orElse,
Implementation
static AsyncBuilder combine4<A, B, C, D>(
Future<A> snapshot1,
Future<B> snapshot2,
Future<C> snapshot3,
Future<D> snapshot4, {
required Widget Function(
BuildContext context, A data1, B data2, C data3, D data4)
onData,
Widget Function(BuildContext context, Widget child, A? data1, B? data2,
C? data3, D? data4)?
builder,
ErrorBuilder? onError,
WidgetBuilder? onLoading,
WidgetBuilder? orElse,
}) =>
AsyncBuilder._(
snapshots: [snapshot1, snapshot2, snapshot3, snapshot4],
onData: (context, data) => onData(
context, data[0] as A, data[1] as B, data[2] as C, data[3] as D),
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?)
: child,
onError: onError,
onLoading: onLoading,
orElse: orElse,
);