tryParse static method

HexString? tryParse(
  1. String input
)

Implementation

static HexString? tryParse(String input) {
  String test;
  if (input.startsWith('0x')) {
    test = input.substring(2);
  } else {
    test = input;
  }
  for (var c in test.characters) {
    if (!hexValues.contains(c)) {
      return null;
    }
  }
  return HexString._(input);
}