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/provider_branches_models/profile/services.dart

86 lines
2.2 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"],
data: json["data"] == null ? null : List<ServicesData>.from(json["data"].map((x) => ServicesData.fromJson(x))),
messageStatus: json["messageStatus"],
message: json["message"],
);
Map<String, dynamic> toJson() =>
{
"totalItemsCount": totalItemsCount,
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
"messageStatus": messageStatus,
"message": 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"],
description: json["description"] ?? (json["serviceDescription"]),
descriptionN: json["descriptionN"] ?? (json["serviceDescriptionN"]),
serviceIconUrl: json["serviceIconUrl"],
serviceImageUrl: json["serviceImageUrl"],
serviceCategoryId: json["serviceCategoryID"],
categoryName: json["categoryName"],
isSelected: false,
);
Map<String, dynamic> toJson() =>
{
"id": id,
"description": description,
"descriptionN": descriptionN,
"serviceIconUrl": serviceIconUrl,
"serviceImageUrl": serviceImageUrl,
"serviceCategoryID": serviceCategoryId,
"categoryName": categoryName,
};
}