class OffersModel { String id; String name; String namen; List localizedNames; Null description; int categoryTemplateId; String metaKeywords; String metaDescription; String metaTitle; int parentCategoryId; int pageSize; String pageSizeOptions; Null priceRanges; bool showOnHomePage; bool includeInTopMenu; Null hasDiscountsApplied; bool published; bool deleted; int displayOrder; String createdOnUtc; String updatedOnUtc; List roleIds; List discountIds; List storeIds; Image image; String seName; bool isLeaf; OffersModel( {this.id, this.name, this.namen, this.localizedNames, this.description, this.categoryTemplateId, this.metaKeywords, this.metaDescription, this.metaTitle, this.parentCategoryId, this.pageSize, this.pageSizeOptions, this.priceRanges, this.showOnHomePage, this.includeInTopMenu, this.hasDiscountsApplied, this.published, this.deleted, this.displayOrder, this.createdOnUtc, this.updatedOnUtc, this.roleIds, this.discountIds, this.storeIds, this.image, this.seName, this.isLeaf}); OffersModel.fromJson(Map json) { id = json['id']; name = json['name']; namen = json['namen']; if (json['localized_names'] != null) { localizedNames = new List(); json['localized_names'].forEach((v) { localizedNames.add(new LocalizedNames.fromJson(v)); }); } description = json['description']; categoryTemplateId = json['category_template_id']; metaKeywords = json['meta_keywords']; metaDescription = json['meta_description']; metaTitle = json['meta_title']; parentCategoryId = json['parent_category_id']; pageSize = json['page_size']; pageSizeOptions = json['page_size_options']; priceRanges = json['price_ranges']; showOnHomePage = json['show_on_home_page']; includeInTopMenu = json['include_in_top_menu']; hasDiscountsApplied = json['has_discounts_applied']; published = json['published']; deleted = json['deleted']; displayOrder = json['display_order']; createdOnUtc = json['created_on_utc']; updatedOnUtc = json['updated_on_utc']; image = json['image'] != null ? new Image.fromJson(json['image']) : null; seName = json['se_name']; isLeaf = json['is_leaf']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['name'] = this.name; data['namen'] = this.namen; if (this.localizedNames != null) { data['localized_names'] = this.localizedNames.map((v) => v.toJson()).toList(); } data['description'] = this.description; data['category_template_id'] = this.categoryTemplateId; data['meta_keywords'] = this.metaKeywords; data['meta_description'] = this.metaDescription; data['meta_title'] = this.metaTitle; data['parent_category_id'] = this.parentCategoryId; data['page_size'] = this.pageSize; data['page_size_options'] = this.pageSizeOptions; data['price_ranges'] = this.priceRanges; data['show_on_home_page'] = this.showOnHomePage; data['include_in_top_menu'] = this.includeInTopMenu; data['has_discounts_applied'] = this.hasDiscountsApplied; data['published'] = this.published; data['deleted'] = this.deleted; data['display_order'] = this.displayOrder; data['created_on_utc'] = this.createdOnUtc; data['updated_on_utc'] = this.updatedOnUtc; if (this.roleIds != null) { data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList(); } if (this.discountIds != null) { data['discount_ids'] = this.discountIds.map((v) => v.toJson()).toList(); } if (this.storeIds != null) { data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList(); } if (this.image != null) { data['image'] = this.image.toJson(); } data['se_name'] = this.seName; data['is_leaf'] = this.isLeaf; return data; } } class LocalizedNames { int languageId; String localizedName; LocalizedNames({this.languageId, this.localizedName}); LocalizedNames.fromJson(Map json) { languageId = json['language_id']; localizedName = json['localized_name']; } Map toJson() { final Map data = new Map(); data['language_id'] = this.languageId; data['localized_name'] = this.localizedName; return data; } } class Image { String src; Null thumb; Null attachment; Image({this.src, this.thumb, this.attachment}); Image.fromJson(Map json) { src = json['src']; thumb = json['thumb']; attachment = json['attachment']; } Map toJson() { final Map data = new Map(); data['src'] = this.src; data['thumb'] = this.thumb; data['attachment'] = this.attachment; return data; } }