BlocConsumer
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
@Composable
public inline fun <reified BlocA: BlocBase<BlocAState>,BlocAState:Any>
BlocConsumer(
blocTag:String?=null,
noinline buildWhen:BlocBuilderCondition<BlocAState>?=null,
noinline listenWhen: BlocListenerCondition<BlocAState>?=null,
crossinline listener: @DisallowComposableCalls suspend (BlocAState) -> Unit,
crossinline content:@Composable (BlocAState)->Unit)
BlocConsumer
exposes a content
and listener
in order react to new Bloc
states. BlocConsumer
is equivalent to a combined BlocBuilder and BlocListener
@Composable
public inline fun <reified BlocA: BlocBase<BlocAState>,BlocAState:Any>
BlocConsumer(
externallyProvidedBlock:BlocA,
noinline buildWhen:BlocBuilderCondition<BlocAState>?=
This is the same as the previous method but with an explicitly specified Bloc
instance externallyProvidedBlock
, not retrieved implicitly from current registered blocs in the current composable subtree.
Use this method if for example you have retrieved the Bloc already with rememberProvidedBlocOf