classifyGTIN function
Classify input GTIN and returns it
Implementation
GTINType? classifyGTIN(String inputGTIN) {
if (!_isValidText(inputGTIN)) {
throw NonGTINFormatError();
}
final type = GTINTypes[inputGTIN.length];
if (type == null) {
throw GTINLengthException(
message: "Input GTIN don't match any length type [${inputGTIN.length}] .",
);
}
return type;
}