$visibility function

BaseBLoCWidget $visibility(
  1. LiveData<bool> lv, {
  2. required Widget build(
    1. BuildContext context,
    2. bool value
    ),
})

Implementation

BaseBLoCWidget $visibility(
  LiveData<bool> lv, {
  // required bool Function(bool value) when,
  required Widget Function(BuildContext context, bool value) build,
}) {
  return $watch(lv, build: (context, bool isVisible) {
    // var isVisible = when(value);
    return Visibility(
      visible: isVisible,
      child: build(context, isVisible),
    );
  });
}