tryParse static method

ArticleKind tryParse(
  1. String val
)

Implementation

static ArticleKind tryParse(String val) {
  switch (val) {
    case 'retail':
      return ArticleKind.retail;
    case 'basket':
      return ArticleKind.basket;
    case 'outOfCatalogue':
      return ArticleKind.outOfCatalogue;
    default:
      print('$val is not a valid ArticleKind');
      return ArticleKind.unknown;
  }
}