$if<T> function
BaseBLoCWidget<T>
$if<T>(
- LiveData<
T> lv, { - bool condition(
- T value
- Key? key,
- required Widget build(
- BuildContext context,
- T value
Implementation
BaseBLoCWidget<T> $if<T>(
LiveData<T> lv, {
bool Function(T value)? condition,
Key? key,
required Widget Function(BuildContext context, T value) build,
}) {
condition ??= (T v) {
if (v is bool) return v;
return false;
};
return $when<T>(lv) | $case<T>(condition, build: build);
}