Merge branch 'master' of http://34.17.52.79/Haroon6138/car_common_app into faiz_development_common
commit
c57aeaf211
Binary file not shown.
|
After Width: | Height: | Size: 891 B |
@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:mc_common_app/models/services/service_model.dart';
|
||||||
|
|
||||||
|
class BranchModel {
|
||||||
|
final int? id;
|
||||||
|
final int? serviceProviderId;
|
||||||
|
final String? serviceProviderName;
|
||||||
|
final String? branchName;
|
||||||
|
final String? branchDescription;
|
||||||
|
final int? cityId;
|
||||||
|
final String? address;
|
||||||
|
final String? latitude;
|
||||||
|
final String? longitude;
|
||||||
|
final double? distanceKm;
|
||||||
|
final String? openTime;
|
||||||
|
final String? closeTime;
|
||||||
|
final int? status;
|
||||||
|
final dynamic statusText;
|
||||||
|
final List<ServiceModel>? branchServices;
|
||||||
|
|
||||||
|
BranchModel({
|
||||||
|
this.id,
|
||||||
|
this.serviceProviderId,
|
||||||
|
this.serviceProviderName,
|
||||||
|
this.branchName,
|
||||||
|
this.branchDescription,
|
||||||
|
this.cityId,
|
||||||
|
this.address,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.distanceKm,
|
||||||
|
this.openTime,
|
||||||
|
this.closeTime,
|
||||||
|
this.status,
|
||||||
|
this.statusText,
|
||||||
|
this.branchServices,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory BranchModel.fromJson(Map<String, dynamic> json) => BranchModel(
|
||||||
|
id: json["id"],
|
||||||
|
serviceProviderId: json["serviceProviderID"],
|
||||||
|
serviceProviderName: json["serviceProviderName"],
|
||||||
|
branchName: json["branchName"],
|
||||||
|
branchDescription: json["branchDescription"],
|
||||||
|
cityId: json["cityID"],
|
||||||
|
address: json["address"],
|
||||||
|
latitude: json["latitude"],
|
||||||
|
longitude: json["longitude"],
|
||||||
|
distanceKm: json["distanceKM"]?.toDouble(),
|
||||||
|
openTime: json["openTime"],
|
||||||
|
closeTime: json["closeTime"],
|
||||||
|
status: json["status"],
|
||||||
|
statusText: json["statusText"],
|
||||||
|
branchServices: json["branchServices"] == null ? [] : List<ServiceModel>.from(json["branchServices"]!.map((x) => ServiceModel.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"serviceProviderID": serviceProviderId,
|
||||||
|
"serviceProviderName": serviceProviderName,
|
||||||
|
"branchName": branchName,
|
||||||
|
"branchDescription": branchDescription,
|
||||||
|
"cityID": cityId,
|
||||||
|
"address": address,
|
||||||
|
"latitude": latitude,
|
||||||
|
"longitude": longitude,
|
||||||
|
"distanceKM": distanceKm,
|
||||||
|
"openTime": openTime,
|
||||||
|
"closeTime": closeTime,
|
||||||
|
"status": status,
|
||||||
|
"statusText": statusText,
|
||||||
|
"branchServices": branchServices == null ? [] : List<dynamic>.from(branchServices!.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final nearBrancheModel = nearBrancheModelFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'branch_model.dart';
|
||||||
|
|
||||||
|
NearBrancheModel nearBrancheModelFromJson(String str) => NearBrancheModel.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String nearBrancheModelToJson(NearBrancheModel data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class NearBrancheModel {
|
||||||
|
final int? messageStatus;
|
||||||
|
final int? totalItemsCount;
|
||||||
|
final List<BranchModel>? data;
|
||||||
|
final String? message;
|
||||||
|
|
||||||
|
NearBrancheModel({
|
||||||
|
this.messageStatus,
|
||||||
|
this.totalItemsCount,
|
||||||
|
this.data,
|
||||||
|
this.message,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory NearBrancheModel.fromJson(Map<String, dynamic> json) => NearBrancheModel(
|
||||||
|
messageStatus: json["messageStatus"],
|
||||||
|
totalItemsCount: json["totalItemsCount"],
|
||||||
|
data: json["data"] == null ? [] : List<BranchModel>.from(json["data"]!.map((x) => BranchModel.fromJson(x))),
|
||||||
|
message: json["message"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"messageStatus": messageStatus,
|
||||||
|
"totalItemsCount": totalItemsCount,
|
||||||
|
"data": data == null ? [] : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||||
|
"message": message,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
//TODO: this needs to match with ServiceProviderService from backend side
|
||||||
|
class ServiceModel {
|
||||||
|
final int? providerBranchServiceId;
|
||||||
|
final dynamic providerServiceDescription;
|
||||||
|
final int? serviceCategoryId;
|
||||||
|
final int? serviceId;
|
||||||
|
final String? serviceDescription;
|
||||||
|
final String? serviceDescriptionN;
|
||||||
|
final int? status;
|
||||||
|
final dynamic statusText;
|
||||||
|
final bool? isAllowAppointment;
|
||||||
|
final int? customerLocationRange;
|
||||||
|
final int? itemsCount;
|
||||||
|
bool isExpanded;
|
||||||
|
|
||||||
|
ServiceModel({
|
||||||
|
this.providerBranchServiceId,
|
||||||
|
this.providerServiceDescription,
|
||||||
|
this.serviceCategoryId,
|
||||||
|
this.serviceId,
|
||||||
|
this.serviceDescription,
|
||||||
|
this.serviceDescriptionN,
|
||||||
|
this.status,
|
||||||
|
this.statusText,
|
||||||
|
this.isAllowAppointment,
|
||||||
|
this.customerLocationRange,
|
||||||
|
this.itemsCount,
|
||||||
|
required this.isExpanded,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory ServiceModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
ServiceModel(
|
||||||
|
providerBranchServiceId: json["providerBranchServiceID"],
|
||||||
|
providerServiceDescription: json["providerServiceDescription"],
|
||||||
|
serviceCategoryId: json["serviceCategoryID"],
|
||||||
|
serviceId: json["serviceID"],
|
||||||
|
serviceDescription: json["serviceDescription"],
|
||||||
|
serviceDescriptionN: json["serviceDescriptionN"],
|
||||||
|
status: json["status"],
|
||||||
|
statusText: json["statusText"],
|
||||||
|
isAllowAppointment: json["isAllowAppointment"],
|
||||||
|
customerLocationRange: json["customerLocationRange"],
|
||||||
|
itemsCount: json["itemsCount"],
|
||||||
|
isExpanded: false,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() =>
|
||||||
|
{
|
||||||
|
"providerBranchServiceID": providerBranchServiceId,
|
||||||
|
"providerServiceDescription": providerServiceDescription,
|
||||||
|
"serviceCategoryID": serviceCategoryId,
|
||||||
|
"serviceID": serviceId,
|
||||||
|
"serviceDescription": serviceDescription,
|
||||||
|
"serviceDescriptionN": serviceDescriptionN,
|
||||||
|
"status": status,
|
||||||
|
"statusText": statusText,
|
||||||
|
"isAllowAppointment": isAllowAppointment,
|
||||||
|
"customerLocationRange": customerLocationRange,
|
||||||
|
"itemsCount": itemsCount,
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue