tryParse static method
Implementation
static PaymentType tryParse(String? val) {
switch (val) {
case 'cash':
return PaymentType.cash;
case 'mobileMoney':
return PaymentType.mobileMoney;
case 'goods':
return PaymentType.goods;
case 'cheque':
return PaymentType.cheque;
case 'creditCard':
return PaymentType.creditCard;
case 'nope':
return PaymentType.nope;
case '':
return PaymentType.unknown;
default:
print('$val is not a valid paymentType');
return PaymentType.unknown;
}
}