tryParse static method
Implementation
static TicketType tryParse(String val) {
switch (val) {
case 'sell':
return TicketType.sell;
case 'sellDeferred':
return TicketType.sellDeferred;
case 'sellCovered':
return TicketType.sellCovered;
case 'spend':
return TicketType.spend;
case 'spendCovered':
return TicketType.spendCovered;
case 'spendDeferred':
return TicketType.spendDeferred;
case 'stockIn':
return TicketType.stockIn;
case 'stockOut':
return TicketType.stockOut;
case 'wage':
return TicketType.wage;
case '':
return TicketType.unknown;
default:
print('$val is not a valid TicketType');
return TicketType.unknown;
}
}