responsiveValue<T> method
T?
responsiveValue<T>({
- T? mobile,
- T? tablet,
- T? desktop,
- 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;
}