tryParse method

num? tryParse(
  1. String text
)

Parse the number represented by the string. If it's not parsable, returns null.

Implementation

num? tryParse(String text) {
  try {
    return parse(text);
  } on FormatException {
    return null;
  }
}