tryParse static method

u32? 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 u32? tryParse(String source) {
  int? val = int.tryParse(source);
  if (val != null) {
    return u32(val);
  }
  return null;
}