flutterUnitToPixels method

double flutterUnitToPixels(
  1. num flutterUnit
)

To convert a Flutter unit (e.g., double) to pixels (px), you can use the MediaQuery class to access the device's pixel ratio and then multiply the value you want to convert by this ratio.

Implementation

double flutterUnitToPixels(num flutterUnit) {
  return flutterUnit.toDouble() * pixelRatio;
}