CustomSectionDataBaseDto.fromJson constructor

CustomSectionDataBaseDto.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CustomSectionDataBaseDto.fromJson(Map<String, dynamic> json) {
  switch (decodeCustomSectionDataTypeDto(
      CustomSectionDataTypeDtoEnumMap, json["type"] as String)) {
    case CustomSectionDataTypeDto.text:
      return TextCustomSectionDataDto.fromJson(json);
    case CustomSectionDataTypeDto.keyValue:
      return KeyValueCustomSectionDataDto.fromJson(json);
    case CustomSectionDataTypeDto.barcode:
      return BarcodeCustomSectionDataDto.fromJson(json);
    case CustomSectionDataTypeDto.qrCode:
      return QrCodeCustomSectionDataDto.fromJson(json);
  }
  return CustomSectionDataBaseDto(
    type: decodeCustomSectionDataTypeDto(
        CustomSectionDataTypeDtoEnumMap, json["type"] as String),
    sequenceNumber: json["sequenceNumber"] as int,
    customSectionId: json["customSectionId"] as String?,
  );
}