adaptive property

T get adaptive

Return a responsive value based on the type

ResponsiveValue(mobile: 20).value(context)

Implementation

T get adaptive {
  if (context.isMobile) {
    return _convertUnit(mobile, unit);
  } else if (context.isTablet) {
    return _convertUnit(tablet ?? mobile, unit);
  } else if (context.isDesktop) {
    return _convertUnit(desktop ?? tablet ?? mobile, unit);
  } else if (context.isLarge) {
    return _convertUnit(large ?? desktop ?? tablet ?? mobile, unit);
  } else {
    return _convertUnit(mobile, unit);
  }
}