dp property

double get dp

Density-independent pixel

Implementation

double get dp {
  final config = ResponsiveMasterConfig.instance;

  if (!config.enableCaching) {
    return this * (w * 160) / DeviceData.pixelRatio;
  }

  return ResponsiveCache.getOrCompute(
    'dp_$this',
    () => this * (w * 160) / DeviceData.pixelRatio,
    width: DeviceData.width,
    height: DeviceData.height,
    orientation: DeviceData.orientation.toString(),
  );
}