showWhen method

Widget showWhen(
  1. Breakpoint md,
  2. Widget widget
)

Conditionally shows a widget based on the current breakpoint.

  • md: The minimum breakpoint for the widget to be shown.
  • widget: The widget to display when the breakpoint is greater than or equal to md.

Returns the widget or an empty SizedBox if the condition is not met.

Implementation

Widget showWhen(Breakpoint md, Widget widget) {
  if (breakpoint.toSize >= md.toSize) {
    return widget;
  }
  return const SizedBox.shrink();
}