dx method

double dx(
  1. double? initialSize, [
  2. bool any = true
])

Converts the initial pixel size to pixels based on the device type, considering the screen variant.

Example:

double result = sizeConfig.dx(initialSize);

Implementation

double dx(double? initialSize, [bool any = true]) {
  final x = (initialSize ?? 0) / _screenVariant;
  final v = !any && x < 0 ? 1.0 : x;
  return percentageSize(diagonal, v);
}