isFloat function

bool isFloat(
  1. String str, {
  2. double? min,
  3. double? max,
})

Checks if the string represents a finite floating-point number.

If min and/or max are provided, the parsed value must also fall within that inclusive range.

Example:

isFloat('1.5'); // true
isFloat('-3'); // true
isFloat('1.5', min: 0, max: 2); // true
isFloat('5', min: 0, max: 2); // false
isFloat('abc'); // false

Implementation

bool isFloat(String str, {double? min, double? max}) => _isFloat(str, min, max);