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 betweenlowerLimit
andupperLimit
, ensuringupperLimit
is not less thanlowerLimit
. -
safeMinClamp(
num lowerLimit, num upperLimit) → double -
Available on double, provided by the DoubleExtension extension
Clamps the double value betweenlowerLimit
andupperLimit
, ensuringlowerLimit
is not greater thanupperLimit
. -
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.