responsiveValue<T> method

T? responsiveValue<T>({
  1. T? mobile,
  2. T? tablet,
  3. T? desktop,
  4. T? watch,
})

Returns a widget based on the current screen type, with fallback options.

Implementation

T? responsiveValue<T>({
  T? mobile,
  T? tablet,
  T? desktop,
  T? watch,
}) {
  if (isDesktop && desktop != null) return desktop;
  if (isTablet && tablet != null) return tablet;
  if (isPhone && mobile != null) return mobile;
  return watch;
}