// To parse this JSON data, do // // final category = categoryFromJson(jsonString); import 'dart:convert'; Category categoryFromJson(String str) => Category.fromJson(json.decode(str)); String categoryToJson(Category data) => json.encode(data.toJson()); class Category { Category({ this.totalItemsCount, this.data, this.messageStatus, this.message, }); int? totalItemsCount; List? data; int? messageStatus; String? message; factory Category.fromJson(Map json) => Category( totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], data: json["data"] == null ? null : List.from(json["data"].map((x) => CategoryData.fromJson(x))), messageStatus: json["messageStatus"] == null ? null : json["messageStatus"], message: json["message"] == null ? null : json["message"], ); Map toJson() => { "totalItemsCount": totalItemsCount == null ? null : totalItemsCount, "data": data == null ? null : List.from(data!.map((x) => x.toJson())), "messageStatus": messageStatus == null ? null : messageStatus, "message": message == null ? null : message, }; } class CategoryData { CategoryData({ this.id, this.categoryName, this.categoryNameN, this.serviceCategoryIconUrl, this.serviceCategoryImageUrl, }); int? id; String? categoryName; String? categoryNameN; dynamic? serviceCategoryIconUrl; dynamic? serviceCategoryImageUrl; factory CategoryData.fromJson(Map json) => CategoryData( id: json["id"] == null ? null : json["id"], categoryName: json["categoryName"] == null ? null : json["categoryName"], categoryNameN: json["categoryNameN"] == null ? null : json["categoryNameN"], serviceCategoryIconUrl: json["serviceCategoryIconUrl"], serviceCategoryImageUrl: json["serviceCategoryImageUrl"], ); Map toJson() => { "id": id == null ? null : id, "categoryName": categoryName == null ? null : categoryName, "categoryNameN": categoryNameN == null ? null : categoryNameN, "serviceCategoryIconUrl": serviceCategoryIconUrl, "serviceCategoryImageUrl": serviceCategoryImageUrl, }; }