NumExt extension
Num Extensions
- on
-
- num?
Properties
- bottomLeftSharpBorderRadius → SharpBorderRadius
-
Available on num?, provided by the NumExt extension
no setter - bottomRightSharpRadius → SharpBorderRadius
-
Available on num?, provided by the NumExt extension
no setter - circularSharpBorderRadius → SharpBorderRadius
-
Available on num?, provided by the NumExt extension
no setter -
Available on num?, provided by the NumExt extension
no setter - topLeftSharpBorderRadius → SharpBorderRadius
-
Available on num?, provided by the NumExt extension
no setter - topRightSharpBorderRadius → SharpBorderRadius
-
Available on num?, provided by the NumExt extension
no setter
Methods
-
addZeroPrefix(
) → String? - Adds a zero prefix to the given integer if it is less than 10.
-
decreaseByPercentage(
double percentage) → num? - Decreases the number by the given percentage.
-
formatWithMax(
{required num max, String? prefix, String? suffix, int decimalPlaces = 0, String customFormat(num value)?}) → String - Formats the number by adding a prefix or suffix based on its value compared to a threshold, with optional formatting for decimals.
-
generateLoremIpsumWords(
) → String - Generates lorem ipsum text with the given number of words.
-
height(
) → Widget - Leaves given height of space
-
increaseByPercentage(
double percentage) → num? - Increases the number by the given percentage.
-
isBetween(
num first, num second) → bool - Checks if the current value falls between the specified range.
-
isInRange(
num min, num max) → bool -
Available on num?, provided by the NumExt extension
Check if the number is in the rangemin
tomax
. Returnstrue
if the number is in the range,false
otherwise. -
isNull(
) → bool -
Available on num?, provided by the NumExt extension
Checks if the given Strings
is null or empty -
maxSpace(
) → Widget -
Available on num?, provided by the NumExt extension
A widget that takes, at most, an amount of space in a Row, Column,or Flex widget. ThemaxSpace
property converts the integer value to a MaxSpace widget, which is useful for creating flexible layouts where certain elements need to occupy a specific amount of space. -
percentageDifference(
double other) → num? - Calculates the absolute percentage difference between the current number and another number.
-
randomList(
{int min = 0, int max = 100}) → List< num> - Generates a list of random numbers with a given length.
-
space(
) → Widget - This extension provides a method to convert a nullable int value to a Widget that takes a fixed amount of space in the direction of its parent.
-
spaceExpand(
) → Widget - This extension provides a way to handle nullable integers and use them to create a space widget. It validates the nullable integer, converting it to a non-nullable double, and uses it to create a space widget that expands in the cross axis direction.
-
squareSize(
) → Size - Returns Size
-
squareSizeBox(
) → SizedBox -
Available on num?, provided by the NumExt extension
Returns a square Size object with the current value as both width and height. -
toNumeral(
{bool international = true, int digitAfterDecimal = 0}) → String - Converts the number to a numeral format (e.g., 1K, 1M, etc.).
-
validate(
{num value = 0}) → num - Validate given double is not null and returns given value if null.
-
width(
) → Widget - Leaves given width of space