UnitValue.fromMap(Map<String, dynamic> map) { value = map['value']; type = EnumUtils.fromString(UnitType.values, map['type']); }