class UserResponse {
List<User> user;
UserResponse({this.user});
UserResponse.fromJson(Map<String, dynamic> json) {
if (json['json'] != null) {
user = new List<User>();
json['json'].forEach((v) {
user.add(new User.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.user != null) {
data['json'] = this.user.map((v) => v.toJson()).toList();
}
return data;
}
}
class User {
String categoryId;
String catgoryName;
String parentCatId;
SubCategories subCategories;
User(
{this.categoryId,
this.catgoryName,
this.parentCatId,
this.subCategories});
User.fromJson(Map<String, dynamic> json) {
categoryId = json['category_id'];
catgoryName = json['catgory_name'];
parentCatId = json['parent_cat_id'];
subCategories = json['sub_categories'] != null
? new SubCategories.fromJson(json['sub_categories'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['category_id'] = this.categoryId;
data['catgory_name'] = this.catgoryName;
data['parent_cat_id'] = this.parentCatId;
if (this.subCategories != null) {
data['sub_categories'] = this.subCategories.toJson();
}
return data;
}
}
class SubCategories {
String catgoryName;
SubCategories({this.catgoryName});
SubCategories.fromJson(Map<String, dynamic> json) {
catgoryName = json['catgory_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['catgory_name'] = this.catgoryName;
return data;
}
}