CatalogDTO.fromJson constructor

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

Implementation

CatalogDTO.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
  name = json['name'];
  if (json['products'] != null) {
    products = <ProductDTO>[];
    json['products'].forEach((v) {
      products!.add(ProductDTO.fromJson(v));
    });
  }
  if (json['assignedCatalogs'] != null) {
    assignedCatalogs = <CatalogDTO>[];
    json['assignedCatalogs'].forEach((v) {
      assignedCatalogs!.add(CatalogDTO.fromJson(v));
    });
  }
  store = json['store'] != null ? StoreDTO.fromJson(json['store']) : null;
}