|
|
|
|
@ -57,8 +57,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
return const ALoading();
|
|
|
|
|
} else {
|
|
|
|
|
_model = snapshot.data as AssetTransfer?;
|
|
|
|
|
_attachments = _model?.attachments?.map((e) => File(e.attachmentName ?? '')).toList() ?? [];
|
|
|
|
|
|
|
|
|
|
_attachments = _model?.assetTransferAttachments?.map((e) => File(e.attachmentName ?? '')).toList() ?? [];
|
|
|
|
|
return Form(
|
|
|
|
|
key: _formKey,
|
|
|
|
|
child: LoadingManager(
|
|
|
|
|
@ -79,24 +78,24 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildTextWidget('${context.translation.transferType} : ${_model?.transferType?.name ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.assetName} : ${_model?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.model} : ${_model?.modelName ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? ""}'),
|
|
|
|
|
if (_model?.receiverEndUserName != null) _buildTextWidget('${context.translation.receiverName} : ${_model?.receiverEndUserName ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.requestNo} : ${_model?.transferCode ?? ""}'),
|
|
|
|
|
//TODO need to confirm where to display this new data...
|
|
|
|
|
infoText(label:context.translation.gasRequest ,value:_model?.extensionNo ),
|
|
|
|
|
infoText(label:context.translation.employeeId ,value:_model?.employeeId ),
|
|
|
|
|
infoText(label:context.translation.name ,value:_model?.name ),
|
|
|
|
|
infoText(label:context.translation.createdDate ,value:_model?.createdDate?.toInitialVisitCardFormat),
|
|
|
|
|
infoText(label: context.translation.employeeId, value: _model?.employeeId),
|
|
|
|
|
infoText(label: context.translation.name, value: _model?.name),
|
|
|
|
|
infoText(label: context.translation.createdDate, value: _model?.createdDate?.toInitialVisitCardFormat),
|
|
|
|
|
if ((_model?.comment ?? "").isNotEmpty) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
8.height,
|
|
|
|
|
_buildTextWidget(_model!.comment!),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
if (_attachments.isNotEmpty) ...[
|
|
|
|
|
attachmentWidget(),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -106,21 +105,6 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
/// TBD
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// /// TBD
|
|
|
|
|
// // StatusLabel(
|
|
|
|
|
// // label: "",
|
|
|
|
|
// // id: 0,
|
|
|
|
|
// // textColor: AColors.getPriorityStatusTextColor(0),
|
|
|
|
|
// // backgroundColor: AColors.getPriorityStatusColor(0)),
|
|
|
|
|
// 8.width,
|
|
|
|
|
//
|
|
|
|
|
// /// TBD
|
|
|
|
|
// //StatusLabel(label: '', textColor: AColors.getRequestStatusTextColor(0), backgroundColor: AColors.getRequestStatusColor(0)),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
1.width,
|
|
|
|
|
Text(
|
|
|
|
|
_model?.createdOn != null ? _model!.createdOn!.toServiceRequestCardFormat : "",
|
|
|
|
|
@ -136,12 +120,8 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
_buildCard(
|
|
|
|
|
isSender: true,
|
|
|
|
|
site: _model?.senderSiteName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
|
|
|
|
|
/// TBD
|
|
|
|
|
unit: _model?.senderDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
comment: _model?.senderComment ?? "",
|
|
|
|
|
|
|
|
|
|
/// TBD
|
|
|
|
|
statusLabel: _model?.senderMachineStatusName != null
|
|
|
|
|
? StatusLabel(
|
|
|
|
|
label: _model!.senderMachineStatusName!,
|
|
|
|
|
@ -156,12 +136,8 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
_buildCard(
|
|
|
|
|
isSender: false,
|
|
|
|
|
site: _model?.destSiteName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
|
|
|
|
|
/// TBD
|
|
|
|
|
unit: _model?.destDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
comment: _model?.receiverComment ?? "",
|
|
|
|
|
|
|
|
|
|
/// TBD
|
|
|
|
|
statusLabel: _model?.receiverMachineStatusName != null
|
|
|
|
|
? StatusLabel(
|
|
|
|
|
label: _model!.receiverMachineStatusName ?? "",
|
|
|
|
|
@ -181,11 +157,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_buildDetailsCard(Widget widget) {
|
|
|
|
|
return widget.toShadowContainer(context).paddingOnly(top: 14, start: 14, end: 14);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget attachmentWidget(){
|
|
|
|
|
Widget attachmentWidget() {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -200,7 +172,6 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
enabled: false,
|
|
|
|
|
onlyImages: false,
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
@ -253,21 +224,19 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
8.height,
|
|
|
|
|
_buildTextWidget(comment),
|
|
|
|
|
attachmentWidget(),
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context);
|
|
|
|
|
}
|
|
|
|
|
Widget infoText({String ?label,String ?value,}){
|
|
|
|
|
if(value==null||value.isEmpty){
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
Widget infoText({
|
|
|
|
|
String? label,
|
|
|
|
|
String? value,
|
|
|
|
|
}) {
|
|
|
|
|
if (value == null || value.isEmpty) {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
} else {
|
|
|
|
|
return '$label: $value'.bodyText(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|