isValid static method
Checks if a string could be an ObjectId. Throws an ArgumentError if
hexString
is null.
Implementation
static bool isValid(String? hexString) {
if (hexString == null) {
throw ArgumentError.notNull('hexString');
}
return hexString.length == 24 && _checkForHexRegExp.hasMatch(hexString);
}