DoubleExtension extension

Extension for double values that provides safe clamping methods.

on

Methods

roundToDecimals(int decimals) double

Available on double, provided by the DoubleExtension extension

Rounds the number to the given number of decimal places.
safeMaxClamp(num lowerLimit, num upperLimit) double

Available on double, provided by the DoubleExtension extension

Clamps the double value between lowerLimit and upperLimit, ensuring upperLimit is not less than lowerLimit.
safeMinClamp(num lowerLimit, num upperLimit) double

Available on double, provided by the DoubleExtension extension

Clamps the double value between lowerLimit and upperLimit, ensuring lowerLimit is not greater than upperLimit.
toDevicePixels(BuildContext context) int

Available on double, provided by the DoubleExtension extension

Converts the current double value to device pixels based on the device's pixel ratio.