isValidFormatOrThrow static method
Validates that the input is exactly a 128-bit hexadecimal value.
Throws a FormatException when isValidUUIDFormat returns false.
Implementation
static void isValidFormatOrThrow({
String fromString = '',
Uint8List? fromByteList,
bool noDashes = false,
}) {
final isValid = isValidUUIDFormat(
fromString: fromString,
fromByteList: fromByteList,
noDashes: noDashes,
);
if (!isValid) {
throw FormatException(
'The provided UUID has an invalid format.',
fromByteList ?? fromString,
);
}
}