visible method
Controls the visibility of the widget.
If visible is false, it returns a SizedBox or a custom default widget.
Text("Visible").visible(true);
Implementation
Widget visible(bool visible, {Widget? defaultWidget}) {
return visible ? this! : (defaultWidget ?? const SizedBox());
}