You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_common_app/lib/models/profile/services.dart

85 lines
2.9 KiB
Dart

// To parse this JSON data, do
//
// final services = servicesFromJson(jsonString);
import 'dart:convert';
Services servicesFromJson(String str) => Services.fromJson(json.decode(str));
String servicesToJson(Services data) => json.encode(data.toJson());
class Services {
Services({
this.totalItemsCount,
this.data,
this.messageStatus,
this.message,
});
int? totalItemsCount;
List<ServicesData>? data;
int? messageStatus;
String? message;
factory Services.fromJson(Map<String, dynamic> json) =>
Services(
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
data: json["data"] == null ? null : List<ServicesData>.from(json["data"].map((x) => ServicesData.fromJson(x))),
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
message: json["message"] == null ? null : json["message"],
);
Map<String, dynamic> toJson() =>
{
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
"messageStatus": messageStatus == null ? null : messageStatus,
"message": message == null ? null : message,
};
}
class ServicesData {
ServicesData({
this.id,
this.description,
this.descriptionN,
this.serviceIconUrl,
this.serviceImageUrl,
this.serviceCategoryId,
this.categoryName,
this.isSelected,
});
int? id;
String? description;
String? descriptionN;
dynamic? serviceIconUrl;
dynamic? serviceImageUrl;
int? serviceCategoryId;
dynamic? categoryName;
bool? isSelected;
factory ServicesData.fromJson(Map<String, dynamic> json) =>
ServicesData(
id: json["id"] == null ? null : json["id"],
description: json["description"] == null ? (json["serviceDescription"] == null ? null : json["serviceDescription"]) : json["description"],
descriptionN: json["descriptionN"] == null ? (json["serviceDescriptionN"] == null ? null : json["serviceDescriptionN"]) : json["descriptionN"],
serviceIconUrl: json["serviceIconUrl"] == null ? null : json["serviceIconUrl"],
serviceImageUrl: json["serviceImageUrl"] == null ? null : json["serviceImageUrl"],
serviceCategoryId: json["serviceCategoryID"] == null ? null : json["serviceCategoryID"],
categoryName: json["categoryName"] == null ? null : json["categoryName"],
isSelected: false,
);
Map<String, dynamic> toJson() =>
{
"id": id == null ? null : id,
"description": description == null ? null : description,
"descriptionN": descriptionN == null ? null : descriptionN,
"serviceIconUrl": serviceIconUrl,
"serviceImageUrl": serviceImageUrl,
"serviceCategoryID": serviceCategoryId == null ? null : serviceCategoryId,
"categoryName": categoryName,
};
}