toDevicePixels method
Converts the current double value to device pixels based on the device's pixel ratio.
This method multiplies the current value by the device pixel ratio obtained from the MediaQuery of the provided BuildContext, and then converts the result to an integer.
context
: The BuildContext used to retrieve the device's pixel ratio.
Returns an integer representing the value in device pixels.
Implementation
int toDevicePixels(BuildContext context) {
return (this * MediaQuery.devicePixelRatioOf(context)).toInt();
}