isFloat static method

bool isFloat(
  1. String text
)

Tests whether text is a valid integer.

Implementation

static bool isFloat(String text) {
  var rc = false;
  if (text.isNotEmpty) {
    try {
      double.parse(text);
      rc = true;
    } on FormatException {
      // nothing to do
    }
  }
  return rc;
}