on static method

Widget on(
  1. BuildContext context, {
  2. Widget? mobile,
  3. Widget? tablet,
  4. Widget? desktop,
})

Implementation

static Widget on(
  BuildContext context, {
  Widget? mobile,
  Widget? tablet,
  Widget? desktop,
}) {
  if (BreakPoint.isMobile(context)) {
    if (mobile != null)
      return mobile;
    else if (tablet != null)
      return tablet;
    else if (desktop != null)
      return desktop;
    else
      return Container();
  } else if (BreakPoint.isTablet(context)) {
    if (tablet != null)
      return tablet;
    else if (desktop != null)
      return desktop;
    else
      return Container();
  } else if (BreakPoint.isDesktop(context)) {
    if (desktop != null)
      return desktop;
    else
      return Container();
  } else
    return Container();
}