tryParse static method

i8? tryParse(
  1. String source
)

Parse source as a, signed integer literal.

Like parse except that this function returns null where a similar call to parse would throw a FormatException.

Implementation

static i8? tryParse(String source) {
  int? val = int.tryParse(source);
  if (val != null) {
    return i8(val);
  }
  return null;
}