isHexString function

bool isHexString(
  1. String value
)

checks if input string is a hex String

Implementation

bool isHexString(String value) {
  if (!RegExp('^0x[0-9A-Fa-f]*\$').hasMatch(value)) {
    return false;
  }
  return true;
}