fromString static method

ItemType fromString(
  1. String type
)

Implementation

static ItemType fromString(String type) {
  switch (type) {
    case 'text':
      return ItemType.text;
    case 'image':
      return ItemType.image;
    case 'imageVideo':
      return ItemType.imageVideo;
    case 'video':
      return ItemType.video;
    case 'audio':
      return ItemType.audio;
    case 'widget':
      return ItemType.widget;
    default:
      return ItemType.none;
  }
}