sp property

double get sp

Scalable pixel - adapts to screen size and pixel density Improved formula for better consistency across devices

Implementation

double get sp {
  final config = ResponsiveMasterConfig.instance;

  if (!config.enableCaching) {
    return _calculateSp();
  }

  return ResponsiveCache.getOrCompute(
    'sp_$this',
    () => _calculateSp(),
    width: DeviceData.width,
    height: DeviceData.height,
    orientation: DeviceData.orientation.toString(),
  );
}