fromString method

DeviceModel fromString(
  1. String name
)

Implementation

DeviceModel fromString(String name) {
  for (var model in DeviceModel.values) {
    if (model.name == name) {
      return model;
    }
  }
  return DeviceModel.unknown;
}