toggleWaitStateFlagIndicator function
void
toggleWaitStateFlagIndicator({
- required BuildContext context,
- required String flag,
- bool show = true,
toggleWaitStateFlagIndicator a generic function that call WaitAction
to add
or remove
a flag. When show
is true
, the flag will be removed.
Implementation
void toggleWaitStateFlagIndicator(
{required BuildContext context, required String flag, bool show = true}) {
show
? StoreProvider.dispatch<CoreState>(
context,
WaitAction<CoreState>.add(flag, ref: '${flag}_ref'),
)
: StoreProvider.dispatch<CoreState>(
context,
WaitAction<CoreState>.remove(flag, ref: '${flag}_ref'),
);
}