buildAs<Z> method

Widget buildAs<Z>(
  1. Widget builder(
    1. BuildContext context,
    2. Z value
    ), {
  2. bool when(
    1. HubbleViewState,
    2. HubbleViewState
    )?,
})
inherited

Implementation

Widget buildAs<Z>(Widget Function(BuildContext context, Z value) builder,
    {bool Function(T, T)? when}) {
  return BlocBuilder<SimpleValueCubit<T>, SimpleValue<T>>(
    bloc: this,
    builder: (context, state) => builder(context, state.value as Z),
    buildWhen:
        when != null ? (prev, cur) => when(prev.value, cur.value) : null,
  );
}