ModelConfig.fromJson constructor

ModelConfig.fromJson(
  1. Map x
)

Implementation

factory ModelConfig.fromJson(Map x) {
  final id = x['id'] as String?;
  final name = x['name'] as String?;
  final description = x['description'] as String?;
  final type = x['type'] as String?;
  final value = x['value'] as String?;

  final cT = getConfigTypeEnum(type);
  final cV = deserilizeValue(cT, value);

  return ModelConfig(
    id: id ?? "",
    name: name ?? "",
    description: description ?? "",
    type: cT,
    value: cV,
  );
}