document library CR implementation
parent
b9a354d2a2
commit
63d4c79a73
@ -1,30 +1,39 @@
|
|||||||
class AssetTransferAttachment {
|
//TODO: need to remove this class
|
||||||
AssetTransferAttachment({
|
// import 'package:test_sa/models/lookup.dart';
|
||||||
this.id,
|
//
|
||||||
this.attachmentName,
|
// class AssetTransferAttachment {
|
||||||
});
|
// AssetTransferAttachment({
|
||||||
|
// this.id,
|
||||||
AssetTransferAttachment.fromJson(dynamic json) {
|
// this.attachmentName,
|
||||||
id = json['id'];
|
// this.documentType,
|
||||||
attachmentName = json['attachmentName'];
|
//
|
||||||
}
|
// });
|
||||||
|
//
|
||||||
num? id; // Now nullable
|
// AssetTransferAttachment.fromJson(dynamic json) {
|
||||||
String? attachmentName; // Now nullable
|
// id = json['id'];
|
||||||
|
// attachmentName = json['attachmentName'];
|
||||||
AssetTransferAttachment copyWith({
|
// }
|
||||||
num? id, // Parameter is now nullable
|
//
|
||||||
String? attachmentName, // Parameter is now nullable
|
// num? id; // Now nullable
|
||||||
}) =>
|
// String? attachmentName; // Now nullable
|
||||||
AssetTransferAttachment(
|
// Lookup ? documentType;
|
||||||
id: id ?? this.id,
|
//
|
||||||
attachmentName: attachmentName ?? this.attachmentName,
|
// AssetTransferAttachment copyWith({
|
||||||
);
|
// num? id, // Parameter is now nullable
|
||||||
|
// String? attachmentName, // Parameter is now nullable
|
||||||
Map<String, dynamic> toJson() {
|
// Lookup? documentType, // Parameter is now nullable
|
||||||
final map = <String, dynamic>{};
|
// }) =>
|
||||||
map['id'] = id;
|
// AssetTransferAttachment(
|
||||||
map['attachmentName'] = attachmentName;
|
// id: id ?? this.id,
|
||||||
return map;
|
// attachmentName: attachmentName ?? this.attachmentName,
|
||||||
}
|
// documentType: documentType ?? this.documentType,
|
||||||
}
|
// );
|
||||||
|
//
|
||||||
|
// Map<String, dynamic> toJson() {
|
||||||
|
// final map = <String, dynamic>{};
|
||||||
|
// map['id'] = id;
|
||||||
|
// map['attachmentName'] = attachmentName;
|
||||||
|
// map['documentTypeId'] = documentType?.id;
|
||||||
|
// return map;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,33 +1,287 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:test_sa/controllers/api_routes/urls.dart';
|
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||||
import 'package:test_sa/models/lookup.dart';
|
import 'package:test_sa/models/lookup.dart';
|
||||||
|
|
||||||
class GenericAttachmentModel {
|
class GenericAttachmentModel {
|
||||||
GenericAttachmentModel({this.id, this.name, this.originalName, this.createdBy, this.documentTypeId});
|
GenericAttachmentModel({
|
||||||
|
this.id,
|
||||||
|
this.name,
|
||||||
|
this.originalName,
|
||||||
|
this.createdBy,
|
||||||
|
this.documentType,
|
||||||
|
this.attachmentDescription,
|
||||||
|
this.attachmentURL,
|
||||||
|
this.moduleReferenceId,
|
||||||
|
this.attachmentTypeId,
|
||||||
|
this.createdDate,
|
||||||
|
this.modifiedBy,
|
||||||
|
this.modifiedDate,
|
||||||
|
this.supplierId,
|
||||||
|
});
|
||||||
|
|
||||||
int? id;
|
int? id;
|
||||||
String? name;
|
String? name;
|
||||||
String? createdBy;
|
String? createdBy;
|
||||||
String? originalName;
|
String? originalName;
|
||||||
Lookup? documentTypeId;
|
Lookup? documentType;
|
||||||
|
String? attachmentDescription;
|
||||||
|
String? attachmentURL;
|
||||||
|
num? moduleReferenceId;
|
||||||
|
num? attachmentTypeId;
|
||||||
|
String? createdDate;
|
||||||
|
String? modifiedBy;
|
||||||
|
String? modifiedDate;
|
||||||
|
num? supplierId;
|
||||||
|
|
||||||
GenericAttachmentModel.fromJson(Map<String, dynamic> json, {bool convertToLink = false}) {
|
GenericAttachmentModel.fromJson(Map<String, dynamic> json, {bool convertToLink = false}) {
|
||||||
id = json['id'];
|
id = json['id'];
|
||||||
name = json['name'] ?? json['imageName'];
|
name = json['name'] ?? json['attachmentName'] ?? json['imageName'];
|
||||||
createdBy = json['createdBy'];
|
createdBy = json['createdBy'];
|
||||||
|
documentType = json['documentType'];
|
||||||
originalName = json['originalName'] ?? json['imageOriginalName'];
|
originalName = json['originalName'] ?? json['imageOriginalName'];
|
||||||
|
|
||||||
if (convertToLink) {
|
if (convertToLink) {
|
||||||
name = URLs.getFileUrl(name);
|
name = URLs.getFileUrl(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromWorkOrderJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
createdBy = json['createdBy'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromLoanJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id']?.toInt();
|
||||||
|
name = json['attachmentName'];
|
||||||
|
attachmentDescription = json['attachmentDescription'];
|
||||||
|
documentType = json['documentType'];
|
||||||
|
moduleReferenceId = json['loanId'];
|
||||||
|
attachmentTypeId = json['loanAttachmentTypeId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromLoanDetailJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
attachmentDescription = json['attachmentDescription'];
|
||||||
|
moduleReferenceId = json['loanId'];
|
||||||
|
attachmentTypeId = json['loanAttachmentTypeId'];
|
||||||
|
createdBy = json['createdBy'];
|
||||||
|
createdDate = json['createdDate'];
|
||||||
|
modifiedBy = json['modifiedBy'];
|
||||||
|
modifiedDate = json['modifiedDate'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromPpmJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'] ?? json['name'];
|
||||||
|
moduleReferenceId = json['visitId'];
|
||||||
|
attachmentURL = json['attachmentURL'];
|
||||||
|
}
|
||||||
|
GenericAttachmentModel.fromSupplierJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'] ?? json['name'];
|
||||||
|
supplierId = json['supplierId'];
|
||||||
|
moduleReferenceId = json['visitId'];
|
||||||
|
attachmentURL = json['attachmentURL'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromGasRefillJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
moduleReferenceId = json['gasRefillId'];
|
||||||
|
documentType = json['documentType'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromIncidentJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
moduleReferenceId = json['incidentId'];
|
||||||
|
attachmentDescription = json['attachmentDescription'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromAssetTransferJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromDemoJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
originalName = json['originalName'];
|
||||||
|
moduleReferenceId = json['demoRequestId'];
|
||||||
|
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromInternalAuditJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
||||||
|
originalName = json['originalName'];
|
||||||
|
createdBy = json['createdBy'];
|
||||||
|
documentType = json['documentType'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromPreventiveVisitJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
documentType = json['documentType'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromAssetJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
attachmentURL = json['attachmentURL'];
|
||||||
|
originalName = json['originalName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericAttachmentModel.fromTrafJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['attachmentName'];
|
||||||
|
moduleReferenceId = json['trafId'];
|
||||||
|
documentType = json['documentType'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
data['id'] = id;
|
data['id'] = id;
|
||||||
data['name'] = name;
|
data['name'] = name;
|
||||||
data['createdBy'] = createdBy;
|
data['createdBy'] = createdBy;
|
||||||
data['originalName'] = originalName;
|
data['originalName'] = originalName;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toWorkOrderJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['name'] = name;
|
||||||
|
data['createdBy'] = createdBy;
|
||||||
|
///TODO need to keep same variable for document type in backend for all modules, currently it is different for different modules
|
||||||
|
if (documentType != null) {
|
||||||
|
data['attachmentTypeId'] = documentType?.id;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toLoanJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['loanId'] = moduleReferenceId;
|
||||||
|
data['loanAttachmentTypeId'] = attachmentTypeId;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
data['attachmentDescription'] = attachmentDescription;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toLoanDetailJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['loanId'] = moduleReferenceId;
|
||||||
|
data['loanAttachmentTypeId'] = attachmentTypeId;
|
||||||
|
data['attachmentDescription'] = attachmentDescription;
|
||||||
|
data['createdBy'] = createdBy;
|
||||||
|
data['createdDate'] = createdDate;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
|
||||||
|
data['modifiedBy'] = modifiedBy;
|
||||||
|
data['modifiedDate'] = modifiedDate;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
//TODO need to check where to use this need to verify with backend team.
|
||||||
|
Map<String, dynamic> toPpmJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['visitId'] = moduleReferenceId;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
data['attachmentURL'] = attachmentURL;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toGasRefillJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['gasRefillId'] = moduleReferenceId;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toIncidentJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['incidentId'] = moduleReferenceId;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
data['attachmentDescription'] = attachmentDescription;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toAssetTransferJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toDemoJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['demoRequestId'] = moduleReferenceId;
|
||||||
|
data['originalName'] = originalName;
|
||||||
|
if (documentType != null) {
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toInternalAuditJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['name'] = name;
|
||||||
|
data['originalName'] = originalName;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toPreventiveVisitJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toAssetJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['attachmentURL'] = attachmentURL;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
data['originalName'] = originalName;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toTrafJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['trafId'] = moduleReferenceId;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toSupplierJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['supplierId'] = supplierId;
|
||||||
|
data['documentTypeId'] = documentType?.id;
|
||||||
|
data['attachmentName'] = name;
|
||||||
|
data['attachmentURL'] = attachmentURL;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +1,42 @@
|
|||||||
class PpmAttachments {
|
//TODO need to delete this
|
||||||
PpmAttachments({
|
|
||||||
this.id,
|
|
||||||
this.visitId,
|
|
||||||
this.attachmentName,
|
|
||||||
this.attachmentURL,
|
|
||||||
});
|
|
||||||
|
|
||||||
PpmAttachments.fromJson(dynamic json) {
|
// class PpmAttachments {
|
||||||
id = json['id'];
|
// PpmAttachments({
|
||||||
visitId = json['visitId'];
|
// this.id,
|
||||||
attachmentName = json['attachmentName'] ?? json['attachmentURL']; // Handle potential null and prioritize'attachmentName'
|
// this.visitId,
|
||||||
}
|
// this.attachmentName,
|
||||||
|
// this.attachmentURL,
|
||||||
num? id; // Now nullable
|
// });
|
||||||
num? visitId; // Now nullable
|
//
|
||||||
String? attachmentName; // Now nullable
|
// PpmAttachments.fromJson(dynamic json) {
|
||||||
String? attachmentURL; // Now nullable
|
// id = json['id'];
|
||||||
|
// visitId = json['visitId'];
|
||||||
PpmAttachments copyWith({
|
// attachmentName = json['attachmentName'] ?? json['attachmentURL']; // Handle potential null and prioritize'attachmentName'
|
||||||
num? id,
|
// }
|
||||||
num? visitId,
|
//
|
||||||
String? attachmentName,
|
// num? id; // Now nullable
|
||||||
String? attachmentURL,
|
// num? visitId; // Now nullable
|
||||||
}) =>
|
// String? attachmentName; // Now nullable
|
||||||
PpmAttachments(
|
// String? attachmentURL; // Now nullable
|
||||||
id: id ?? this.id,
|
//
|
||||||
visitId: visitId ?? this.visitId,
|
// PpmAttachments copyWith({
|
||||||
attachmentName: attachmentName ?? this.attachmentName,attachmentURL: attachmentURL ?? this.attachmentURL,
|
// num? id,
|
||||||
);
|
// num? visitId,
|
||||||
|
// String? attachmentName,
|
||||||
Map<String, dynamic> toJson() {
|
// String? attachmentURL,
|
||||||
final map = <String, dynamic>{};
|
// }) =>
|
||||||
map['id'] = id;
|
// PpmAttachments(
|
||||||
map['visitId'] = visitId;
|
// id: id ?? this.id,
|
||||||
map['attachmentName'] = attachmentName;
|
// visitId: visitId ?? this.visitId,
|
||||||
map['attachmentURL'] = attachmentURL;
|
// attachmentName: attachmentName ?? this.attachmentName,attachmentURL: attachmentURL ?? this.attachmentURL,
|
||||||
return map;
|
// );
|
||||||
}
|
//
|
||||||
}
|
// Map<String, dynamic> toJson() {
|
||||||
|
// final map = <String, dynamic>{};
|
||||||
|
// map['id'] = id;
|
||||||
|
// map['visitId'] = visitId;
|
||||||
|
// map['attachmentName'] = attachmentName;
|
||||||
|
// map['attachmentURL'] = attachmentURL;
|
||||||
|
// return map;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
@ -1,31 +1,33 @@
|
|||||||
import 'package:test_sa/models/lookup.dart';
|
//TODO : need to remove this class
|
||||||
|
|
||||||
class DemoAttachments {
|
// import 'package:test_sa/models/lookup.dart';
|
||||||
int? id;
|
//
|
||||||
num? demoRequestId;
|
// class DemoAttachments {
|
||||||
num? documentTypeId;
|
// int? id;
|
||||||
Lookup? documentType;
|
// num? demoRequestId;
|
||||||
String? attachmentName;
|
// Lookup? documentType;
|
||||||
String? originalName;
|
// String? attachmentName;
|
||||||
|
// String? originalName;
|
||||||
DemoAttachments({this.id, this.documentTypeId, this.documentType, this.attachmentName, this.demoRequestId, this.originalName});
|
//
|
||||||
|
// DemoAttachments({this.id, this.documentType, this.attachmentName, this.demoRequestId, this.originalName});
|
||||||
DemoAttachments.fromJson(dynamic json) {
|
//
|
||||||
id = json['id'];
|
// DemoAttachments.fromJson(dynamic json) {
|
||||||
documentTypeId = json['documentTypeId'];
|
// id = json['id'];
|
||||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
// documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||||
demoRequestId = json['demoRequestId'];
|
// demoRequestId = json['demoRequestId'];
|
||||||
attachmentName = json['attachmentName'];
|
// attachmentName = json['attachmentName'];
|
||||||
originalName = json['originalName'];
|
// originalName = json['originalName'];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Map<String, dynamic> toJson() {
|
// Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
// final map = <String, dynamic>{};
|
||||||
map['id'] = id;
|
// map['id'] = id;
|
||||||
map['documentTypeId'] = documentTypeId;
|
// if(documentType!=null){
|
||||||
map['attachmentName'] = attachmentName;
|
// map['documentTypeId'] = documentType?.id;
|
||||||
map['demoRequestId'] = demoRequestId;
|
// }
|
||||||
map['originalName'] = originalName;
|
// map['attachmentName'] = attachmentName;
|
||||||
return map;
|
// map['demoRequestId'] = demoRequestId;
|
||||||
}
|
// map['originalName'] = originalName;
|
||||||
}
|
// return map;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,24 +1,26 @@
|
|||||||
class IncidentAttachments {
|
//TODO : need to delete this
|
||||||
num? id;
|
|
||||||
num? incidentId;
|
|
||||||
String? attachmentName;
|
|
||||||
String? attachmentDescription;
|
|
||||||
|
|
||||||
IncidentAttachments({this.id, this.attachmentName, this.incidentId, this.attachmentDescription});
|
// class IncidentAttachments {
|
||||||
|
// num? id;
|
||||||
IncidentAttachments.fromJson(dynamic json) {
|
// num? incidentId;
|
||||||
id = json['id'];
|
// String? attachmentName;
|
||||||
incidentId = json['incidentId'];
|
// String? attachmentDescription;
|
||||||
attachmentName = json['attachmentName'];
|
//
|
||||||
attachmentDescription = json['attachmentDescription'];
|
// IncidentAttachments({this.id, this.attachmentName, this.incidentId, this.attachmentDescription});
|
||||||
}
|
//
|
||||||
|
// IncidentAttachments.fromJson(dynamic json) {
|
||||||
Map<String, dynamic> toJson() {
|
// id = json['id'];
|
||||||
final map = <String, dynamic>{};
|
// incidentId = json['incidentId'];
|
||||||
map['id'] = id;
|
// attachmentName = json['attachmentName'];
|
||||||
map['attachmentName'] = attachmentName;
|
// attachmentDescription = json['attachmentDescription'];
|
||||||
map['incidentId'] = incidentId;
|
// }
|
||||||
map['attachmentDescription'] = attachmentDescription;
|
//
|
||||||
return map;
|
// Map<String, dynamic> toJson() {
|
||||||
}
|
// final map = <String, dynamic>{};
|
||||||
}
|
// map['id'] = id;
|
||||||
|
// map['attachmentName'] = attachmentName;
|
||||||
|
// map['incidentId'] = incidentId;
|
||||||
|
// map['attachmentDescription'] = attachmentDescription;
|
||||||
|
// return map;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,26 +1,32 @@
|
|||||||
import 'dart:developer';
|
//TODO : need to remove this class.
|
||||||
|
// import 'dart:developer';
|
||||||
class InternalAuditAttachments {
|
//
|
||||||
InternalAuditAttachments({this.id, this.originalName, this.name, this.createdBy});
|
// import 'package:test_sa/models/lookup.dart';
|
||||||
|
//
|
||||||
int? id;
|
// class InternalAuditAttachments {
|
||||||
String? name;
|
// InternalAuditAttachments({this.id, this.originalName, this.name, this.createdBy,this.documentType});
|
||||||
String? originalName;
|
//
|
||||||
String? createdBy;
|
// int? id;
|
||||||
|
// String? name;
|
||||||
InternalAuditAttachments.fromJson(Map<String, dynamic> json) {
|
// String? originalName;
|
||||||
id = json['id'];
|
// String? createdBy;
|
||||||
name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
// Lookup ? documentType;
|
||||||
originalName = json['originalName'];
|
//
|
||||||
createdBy = json['createdBy'];
|
// InternalAuditAttachments.fromJson(Map<String, dynamic> json) {
|
||||||
}
|
// id = json['id'];
|
||||||
|
// name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
||||||
Map<String, dynamic> toJson() {
|
// originalName = json['originalName'];
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
// createdBy = json['createdBy'];
|
||||||
data['id'] = id;
|
// documentType =json['documentType'];
|
||||||
data['name'] = name;
|
// }
|
||||||
data['originalName'] = originalName;
|
//
|
||||||
// data['createdBy'] = createdBy;
|
// Map<String, dynamic> toJson() {
|
||||||
return data;
|
// final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
}
|
// data['id'] = id;
|
||||||
}
|
// data['name'] = name;
|
||||||
|
// data['originalName'] = originalName;
|
||||||
|
// data['documentTypeId'] = documentType?.id;
|
||||||
|
// // data['createdBy'] = createdBy;
|
||||||
|
// return data;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,39 +1,40 @@
|
|||||||
class LoanAttachmentModel {
|
//TODO need to delete this .
|
||||||
int? loanId;
|
// class LoanAttachmentModel {
|
||||||
String? attachmentName;
|
// int? loanId;
|
||||||
int? loanAttachmentTypeId;
|
// String? attachmentName;
|
||||||
String? attachmentDescription;
|
// int? loanAttachmentTypeId;
|
||||||
int? id;
|
// String? attachmentDescription;
|
||||||
String? createdBy;
|
// int? id;
|
||||||
String? createdDate;
|
// String? createdBy;
|
||||||
String? modifiedBy;
|
// String? createdDate;
|
||||||
String? modifiedDate;
|
// String? modifiedBy;
|
||||||
|
// String? modifiedDate;
|
||||||
LoanAttachmentModel({this.loanId, this.attachmentName, this.loanAttachmentTypeId, this.attachmentDescription, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate});
|
//
|
||||||
|
// LoanAttachmentModel({this.loanId, this.attachmentName, this.loanAttachmentTypeId, this.attachmentDescription, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate});
|
||||||
LoanAttachmentModel.fromJson(Map<String, dynamic> json) {
|
//
|
||||||
loanId = json['loanId'];
|
// LoanAttachmentModel.fromJson(Map<String, dynamic> json) {
|
||||||
attachmentName = json['attachmentName'];
|
// loanId = json['loanId'];
|
||||||
loanAttachmentTypeId = json['loanAttachmentTypeId'];
|
// attachmentName = json['attachmentName'];
|
||||||
attachmentDescription = json['attachmentDescription'];
|
// loanAttachmentTypeId = json['loanAttachmentTypeId'];
|
||||||
id = json['id'];
|
// attachmentDescription = json['attachmentDescription'];
|
||||||
createdBy = json['createdBy'];
|
// id = json['id'];
|
||||||
createdDate = json['createdDate'];
|
// createdBy = json['createdBy'];
|
||||||
modifiedBy = json['modifiedBy'];
|
// createdDate = json['createdDate'];
|
||||||
modifiedDate = json['modifiedDate'];
|
// modifiedBy = json['modifiedBy'];
|
||||||
}
|
// modifiedDate = json['modifiedDate'];
|
||||||
|
// }
|
||||||
Map<String, dynamic> toJson() {
|
//
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
// Map<String, dynamic> toJson() {
|
||||||
data['loanId'] = this.loanId;
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['attachmentName'] = this.attachmentName;
|
// data['loanId'] = this.loanId;
|
||||||
data['loanAttachmentTypeId'] = this.loanAttachmentTypeId;
|
// data['attachmentName'] = this.attachmentName;
|
||||||
data['attachmentDescription'] = this.attachmentDescription;
|
// data['loanAttachmentTypeId'] = this.loanAttachmentTypeId;
|
||||||
data['id'] = this.id;
|
// data['attachmentDescription'] = this.attachmentDescription;
|
||||||
data['createdBy'] = this.createdBy;
|
// data['id'] = this.id;
|
||||||
data['createdDate'] = this.createdDate;
|
// data['createdBy'] = this.createdBy;
|
||||||
data['modifiedBy'] = this.modifiedBy;
|
// data['createdDate'] = this.createdDate;
|
||||||
data['modifiedDate'] = this.modifiedDate;
|
// data['modifiedBy'] = this.modifiedBy;
|
||||||
return data;
|
// data['modifiedDate'] = this.modifiedDate;
|
||||||
}
|
// return data;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -0,0 +1,346 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||||
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/string_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/text_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||||
|
import 'package:test_sa/models/device/asset_by_id_model.dart';
|
||||||
|
import 'package:test_sa/models/generic_attachment_model.dart';
|
||||||
|
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
|
||||||
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
||||||
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
||||||
|
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
|
||||||
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
||||||
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
||||||
|
|
||||||
|
class AssetDetailsView extends StatefulWidget {
|
||||||
|
final AssetByIdModel assetModel;
|
||||||
|
final VoidCallback onUpload;
|
||||||
|
|
||||||
|
const AssetDetailsView({
|
||||||
|
Key? key,
|
||||||
|
required this.assetModel,
|
||||||
|
required this.onUpload,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AssetDetailsView> createState() => _AssetDetailsViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AssetDetailsViewState extends State<AssetDetailsView> with SingleTickerProviderStateMixin {
|
||||||
|
late AnimationController _animationController;
|
||||||
|
List<GenericAttachmentModel> attachments = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_animationController = AnimationController(
|
||||||
|
duration: const Duration(milliseconds: 1400),
|
||||||
|
vsync: this,
|
||||||
|
);
|
||||||
|
attachments = widget.assetModel.assetAttachments?.whereType<GenericAttachmentModel>().toList() ?? [];
|
||||||
|
_animationController.forward(from: 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_animationController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// Image animation - fade in with scale
|
||||||
|
final imageAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.0, 0.4, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final imageScaleAnimation = Tween<double>(begin: 0.92, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.0, 0.4, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Status label animation
|
||||||
|
final statusAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.15, 0.5, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final statusSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.2),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.15, 0.5, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Header animation
|
||||||
|
final headerAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.25, 0.6, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final headerSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.2),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.25, 0.6, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Details row animation
|
||||||
|
final detailsAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.35, 0.75, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final detailsSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.15),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.35, 0.75, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Dates section animation
|
||||||
|
final datesAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.50, 0.9, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final datesSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.15),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.50, 0.9, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Description animation (if exists)
|
||||||
|
final descAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.65, 1.0, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final descSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.1),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.65, 1.0, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final attachmentAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.80, 1.0, curve: Curves.easeOut),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final attachmentSlideAnimation = Tween<Offset>(
|
||||||
|
begin: const Offset(0.0, 0.1),
|
||||||
|
end: Offset.zero,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: _animationController,
|
||||||
|
curve: const Interval(0.80, 1.0, curve: Curves.easeOutCubic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Animated image
|
||||||
|
FadeTransition(
|
||||||
|
opacity: imageAnimation,
|
||||||
|
child: ScaleTransition(
|
||||||
|
scale: imageScaleAnimation,
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: 159 / 94,
|
||||||
|
child: Container(
|
||||||
|
width: 95,
|
||||||
|
height: 95,
|
||||||
|
decoration: ShapeDecoration(
|
||||||
|
color: AppColor.neutral30,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
image: DecorationImage(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
image: NetworkImage(widget.assetModel.assetPhoto != null ? URLs.getFileUrl(widget.assetModel.assetPhoto!)! : "https://www.lasteelcraft.com/images/no-image-available.png"),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
6.height,
|
||||||
|
// Animated content column
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Status label with animation
|
||||||
|
if (widget.assetModel.commissioningStatus != null)
|
||||||
|
FadeTransition(
|
||||||
|
opacity: statusAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: statusSlideAnimation,
|
||||||
|
child: StatusLabel(
|
||||||
|
label: widget.assetModel.commissioningStatus!.name,
|
||||||
|
textColor: AppColor.getRequestStatusTextColorByName(context, widget.assetModel.commissioningStatus!.name!),
|
||||||
|
backgroundColor: AppColor.getRequestStatusColorByName(context, widget.assetModel.commissioningStatus!.name!),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (widget.assetModel.commissioningStatus != null) 8.height,
|
||||||
|
|
||||||
|
// Header with animation
|
||||||
|
FadeTransition(
|
||||||
|
opacity: headerAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: headerSlideAnimation,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
spacing: 2,
|
||||||
|
children: [
|
||||||
|
InfoHeader16Widget(widget.assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"),
|
||||||
|
if (context.userProvider.isEngineer && !(widget.assetModel.hasTrainingImageData ?? true))
|
||||||
|
const InfoTextLabelWidget(label: '*Upload Images for this asset', color: AppColor.red30),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
// Details row with animation
|
||||||
|
FadeTransition(
|
||||||
|
opacity: detailsAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: detailsSlideAnimation,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
InfoTextWidget(label: context.translation.assetNo, value: widget.assetModel.multiAssets!.first.assetNumber, showEmptyValue: true, copyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.modelName, value: widget.assetModel.modelDefinition!.modelName, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.supplier, value: widget.assetModel.supplier?.suppliername, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.manufacture, value: widget.assetModel.modelDefinition!.manufacturerName, showEmptyValue: true),
|
||||||
|
],
|
||||||
|
).expanded,
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
InfoTextWidget(label: context.translation.snNo, value: widget.assetModel.multiAssets!.first.assetSerialNo, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.site, value: widget.assetModel.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.building, value: widget.assetModel.building?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.floor, value: widget.assetModel.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.md, value: widget.assetModel.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.room, value: widget.assetModel.room?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
||||||
|
],
|
||||||
|
).expanded,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Divider with animation
|
||||||
|
FadeTransition(
|
||||||
|
opacity: datesAnimation,
|
||||||
|
child: const Divider().defaultStyle(context),
|
||||||
|
),
|
||||||
|
// Dates section with animation
|
||||||
|
FadeTransition(
|
||||||
|
opacity: datesAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: datesSlideAnimation,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
InfoTextWidget(label: context.translation.installationDate, value: widget.assetModel.installationDate?.toAssetDetailsFormat, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.nextPmDate, value: widget.assetModel.nextPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
||||||
|
InfoTextWidget(label: context.translation.lastPmDate, value: widget.assetModel.lastPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Description with animation (if exists)
|
||||||
|
if ((widget.assetModel.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[
|
||||||
|
FadeTransition(
|
||||||
|
opacity: descAnimation,
|
||||||
|
child: const Divider().defaultStyle(context),
|
||||||
|
),
|
||||||
|
FadeTransition(
|
||||||
|
opacity: descAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: descSlideAnimation,
|
||||||
|
child: InfoTextWidget(label: widget.assetModel.modelDefinition!.assetDescription!, showEmptyValue: true, isMsg: true),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
if (attachments.isNotEmpty) ...[
|
||||||
|
FadeTransition(
|
||||||
|
opacity: attachmentAnimation,
|
||||||
|
child: const Divider().defaultStyle(context),
|
||||||
|
),
|
||||||
|
FadeTransition(
|
||||||
|
opacity: attachmentAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: attachmentSlideAnimation,
|
||||||
|
child: FilesList(images: attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toShadowContainer(context),
|
||||||
|
).expanded,
|
||||||
|
if (context.userProvider.isEngineer && !(widget.assetModel.hasTrainingImageData ?? true))
|
||||||
|
FooterActionButton.footerContainer(
|
||||||
|
context: context,
|
||||||
|
child: AppFilledButton(
|
||||||
|
buttonColor: AppColor.primary10,
|
||||||
|
label: "Upload Images",
|
||||||
|
onPressed: widget.onUpload,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||||
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
||||||
|
|
||||||
|
class AssetDocumentHistoryView extends StatelessWidget {
|
||||||
|
const AssetDocumentHistoryView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final List<String> dummyDocuments = [
|
||||||
|
'https://picsum.photos/200/300?random=1',
|
||||||
|
'https://picsum.photos/200/300?random=2',
|
||||||
|
'https://picsum.photos/200/300?random=3',
|
||||||
|
'https://picsum.photos/200/300?random=4',
|
||||||
|
'https://picsum.photos/200/300?random=5',
|
||||||
|
];
|
||||||
|
|
||||||
|
return SingleChildScrollView(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth),
|
||||||
|
child: FilesList(
|
||||||
|
showAsListView: true,
|
||||||
|
// itemGap: 12.toScreenHeight,
|
||||||
|
showDownloadButton: true,
|
||||||
|
images: dummyDocuments,
|
||||||
|
).toShadowContainer(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue