fromCodec static method

DVCVariable fromCodec(
  1. Map<String, dynamic> map
)

Implementation

static DVCVariable fromCodec(Map<String, dynamic> map) {
  DVCVariable variable = DVCVariable();
  String mapType = map['type'].toString().toLowerCase();

  variable.id = map['id'];
  variable.key = map['key'];
  variable.type = VariableType.values
      .firstWhereOrNull((e) => e.toString() == "VariableType.$mapType");
  variable.value = map['value'];

  return variable;
}