combine2<A, B> static method
AsyncBuilder
combine2<A, B>(
- Future<
A> snapshot1, - Future<
B> snapshot2, { - required Widget onData(
- BuildContext context,
- A data1,
- B data2
- Widget builder(
- BuildContext context,
- Widget child,
- A? data1,
- B? data2,
- ErrorBuilder? onError,
- WidgetBuilder? onLoading,
- WidgetBuilder? orElse,
Implementation
static AsyncBuilder combine2<A, B>(
Future<A> snapshot1,
Future<B> snapshot2, {
required Widget Function(BuildContext context, A data1, B data2) onData,
Widget Function(BuildContext context, Widget child, A? data1, B? data2)?
builder,
ErrorBuilder? onError,
WidgetBuilder? onLoading,
WidgetBuilder? orElse,
}) =>
AsyncBuilder._(
snapshots: [snapshot1, snapshot2],
onData: (context, data) => onData(context, data[0] as A, data[1] as B),
builder: (context, child, data) => builder != null
? builder.call(context, child, data[0] as A?, data[1] as B?)
: child,
onError: onError,
onLoading: onLoading,
orElse: orElse,
);