show method
Conditional rendering based on breakpoint
Shows child only when the condition is met based on breakpoint.
Returns fallback widget when condition is not met.
Implementation
Widget show({
required Widget child,
bool showOnXs = true,
bool showOnSm = true,
bool showOnMd = true,
bool showOnLg = true,
bool showOnXl = true,
bool showOnXxl = true,
Widget? fallback,
}) {
final shouldShow = value<bool>(
xs: showOnXs,
sm: showOnSm,
md: showOnMd,
lg: showOnLg,
xl: showOnXl,
xxl: showOnXxl,
fallback: true,
);
return shouldShow ? child : (fallback ?? const SizedBox.shrink());
}