merge conflict resolve

main_production
Sikander Saleem 4 days ago
parent 7490544084
commit 50df0fb5b8

@ -28,7 +28,7 @@ class SparePartHelperModel {
this.activityStatusId,
this.activityStatus,
this.comment,
List<SparePartAttachments>? sparePartAttachments,
List<GenericAttachmentModel>? sparePartAttachments,
}) : sparePartAttachments = sparePartAttachments ?? [];
Map<String, dynamic> toJson() {
@ -44,11 +44,11 @@ class SparePartHelperModel {
}
data['comment'] = comment;
if (sparePartAttachments != null) {
data['acitiySparePartAttachments'] =
sparePartAttachments!.map((v) => v?.toJson() ?? {}).toList();
data['acitiySparePartAttachments'] = sparePartAttachments!.map((v) => v?.toJson() ?? {}).toList();
}
return data;
}
Map<String, dynamic> toPMJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
@ -58,7 +58,7 @@ class SparePartHelperModel {
data['comment'] = comment;
data['installQty'] = installQty;
data['returnQty'] = returnQty;
if (sparePartAttachments.isNotEmpty) {
if (sparePartAttachments?.isNotEmpty ?? false) {
data['acitiySparePartAttachments'] = sparePartAttachments!.map((v) => v.toJson()).toList();
}
return data;

@ -65,7 +65,6 @@ class PlanPreventiveVisit {
List<TimerModel>? timerModelList = [];
TimerModel? ppMTimePicker;
PlanPreventiveVisit(
{this.id,
this.visitNo,
@ -109,14 +108,14 @@ class PlanPreventiveVisit {
this.timerModelList,
this.ppMTimePicker,
this.activities,
this.labourCost,
this.sparePartCost,
this.travelCost,
this.qAmount,
this.prNo,
this.poNo,
this.mrNo,
this.exchangeCost,
this.labourCost,
this.sparePartCost,
this.travelCost,
this.qAmount,
this.prNo,
this.poNo,
this.mrNo,
this.exchangeCost,
this.preventiveVisitSuppliers});
PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
@ -153,14 +152,14 @@ class PlanPreventiveVisit {
safety = json['safety'] != null ? Lookup.fromJson(json['safety']) : null;
engSignature = json['engSignature'];
nurseSignature = json['nurseSignature'];
travelCost= json['travelCost'];
sparePartCost= json['sparePartCost'];
labourCost =json['laborCost'];
qAmount= json['qAmount'];
prNo= json['prNo'];
poNo= json['poNo'];
mrNo= json['mrNo'];
exchangeCost= json['exchangeCost'];
travelCost = json['travelCost'];
sparePartCost = json['sparePartCost'];
labourCost = json['laborCost'];
qAmount = json['qAmount'];
prNo = json['prNo'];
poNo = json['poNo'];
mrNo = json['mrNo'];
exchangeCost = json['exchangeCost'];
if (json['preventiveVisitAttachments'] != null) {
preventiveVisitAttachments = <GenericAttachmentModel>[];
json['preventiveVisitAttachments'].forEach((v) {
@ -487,7 +486,7 @@ class PMSparePartActivityModel {
String? comment;
dynamic price;
List<SparePartAttachments> activitySparePartPPMAttachments;
List<GenericAttachmentModel> activitySparePartPPMAttachments;
PMSparePartActivityModel({
this.id,
@ -498,7 +497,7 @@ class PMSparePartActivityModel {
this.returnQty,
this.comment,
this.price,
List<SparePartAttachments>? activitySparePartPPMAttachments,
List<GenericAttachmentModel>? activitySparePartPPMAttachments,
}) : activitySparePartPPMAttachments = activitySparePartPPMAttachments ?? [];
PMSparePartActivityModel.fromJson(Map<String, dynamic> json) : activitySparePartPPMAttachments = [] {
@ -516,13 +515,9 @@ class PMSparePartActivityModel {
price = json['price'];
// Handle typo in API response: "acitiySparePartPPMAttachments" instead of "activitySparePartPPMAttachments"
final attachmentsKey = json.containsKey('acitiySparePartPPMAttachments')
? 'acitiySparePartPPMAttachments'
: 'activitySparePartPPMAttachments';
final attachmentsKey = json.containsKey('acitiySparePartPPMAttachments') ? 'acitiySparePartPPMAttachments' : 'activitySparePartPPMAttachments';
activitySparePartPPMAttachments = json[attachmentsKey] == null
? []
: List.from(json[attachmentsKey]).map((e) => SparePartAttachments.fromJson(e)).toList();
activitySparePartPPMAttachments = json[attachmentsKey] == null ? [] : List.from(json[attachmentsKey]).map((e) => GenericAttachmentModel.fromJson(e)).toList();
}
Map<String, dynamic> toJson() {

@ -185,7 +185,7 @@ class _PmActivitiesListViewState extends State<PmActivitiesListView> {
],
if (activity.activitySparePartPPMAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context),
FilesList(images: activity.activitySparePartPPMAttachments.map((toElement) => URLs.getFileUrl(toElement.name ?? '') ?? '').toList()),
FilesList(images: activity.activitySparePartPPMAttachments.map((toElement) => URLs.getFileUrl(toElement.name ?? '') ?? '').toList(), showAsListView: true),
],
],
).toShadowContainer(context, showShadow: false).onPress(() {

Loading…
Cancel
Save