isHexString function
Implementation
bool isHexString(String value, {int? length}) {
RegExp regExp = RegExp(
r"^0x[0-9A-Fa-f]*$",
);
if (length != null && value.length != 2 + 2 * length) {
return false;
}
return regExp.hasMatch(value);
}