isNumeric method

bool isNumeric()

Checks if the string can be parsed as a number.

Implementation

bool isNumeric() =>
    // Attempt to parse as a double and check if the result is not null.
    double.tryParse(this) != null;