isHexString function

bool isHexString(
  1. String str
)

Implementation

bool isHexString(String str) {
  var result = str.startsWith(RegExp(r'0x', caseSensitive: false))
      ? str.substring(2)
      : str;
  return validators.matches(result, '^[0-9a-fA-F]{${result.length}}');
}