extractUICValues method
List<UICDescription>
extractUICValues(
- String uic, [
- UICCategory category = UICCategory.passengerCoach
Splits a 12-digit uic
into its UICDetails. category
defaults to
UICCategory.passengerCoach. Returns an empty list for non-12-digit
UIC numbers.
Implementation
List<UICDescription> extractUICValues(
String uic, [
UICCategory category = UICCategory.passengerCoach,
]) {
final onlyDigits = uic.replaceAll(_everythingExceptDigits, '');
if (onlyDigits.length < 12) return [];
switch (category) {
case UICCategory.tractionUnit:
return _tractionUnitUIC(onlyDigits);
case UICCategory.passengerCoach:
return _passengerCoachUIC(onlyDigits);
case UICCategory.freightWagon:
return _freightWagonUIC(onlyDigits);
}
}