|
|
|
|
@ -64,53 +64,52 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
onRefresh: () async {},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildDetailsCard(
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
context.translation.transferDetails.heading5(context),
|
|
|
|
|
8.height,
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildTextWidget('${context.translation.assetName} : ${_model?.assetName ??""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber??""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.model} : ${_model?.modelName??""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo??""}'),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
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 : "",
|
|
|
|
|
textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : Color(0xFF3B3D4A))),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(14),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
context.translation.transferDetails.heading5(context),
|
|
|
|
|
8.height,
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildTextWidget('${context.translation.assetName} : ${_model?.assetName ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.model} : ${_model?.modelName ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? ""}'),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
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 : "",
|
|
|
|
|
textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : Color(0xFF3B3D4A))),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context),
|
|
|
|
|
8.height,
|
|
|
|
|
// sender card
|
|
|
|
|
_buildCard(
|
|
|
|
|
isSender: true,
|
|
|
|
|
@ -129,6 +128,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.senderMachineStatusName)))
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
// receiver card
|
|
|
|
|
_buildCard(
|
|
|
|
|
isSender: false,
|
|
|
|
|
@ -148,7 +148,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).paddingAll(16),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -182,42 +182,39 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if ((_userProvider.user?.type == UsersTypes.engineer))
|
|
|
|
|
if(isSender ? (_model?.senderMachineStatusName?.toLowerCase() != "closed" && _model?.senderMachineStatusName?.toLowerCase() != "completed")
|
|
|
|
|
: (_model?.receiverMachineStatusName?.toLowerCase() != "closed" && _model?.receiverMachineStatusName?.toLowerCase() != "completed"))
|
|
|
|
|
CircleAvatar(
|
|
|
|
|
radius: 25,
|
|
|
|
|
backgroundColor: AppColor.neutral30,
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 24,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 3.0),
|
|
|
|
|
child: SvgPicture.asset('assets/images/update.svg'),
|
|
|
|
|
if (isSender
|
|
|
|
|
? (_model?.senderMachineStatusName?.toLowerCase() != "closed" && _model?.senderMachineStatusName?.toLowerCase() != "completed")
|
|
|
|
|
: (_model?.receiverMachineStatusName?.toLowerCase() != "closed" && _model?.receiverMachineStatusName?.toLowerCase() != "completed"))
|
|
|
|
|
CircleAvatar(
|
|
|
|
|
radius: 25,
|
|
|
|
|
backgroundColor: AppColor.neutral30,
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 24,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 3.0),
|
|
|
|
|
child: SvgPicture.asset('assets/images/update.svg'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).onPress(isSender
|
|
|
|
|
? () {
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model, isSender: isSender)));
|
|
|
|
|
}
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model, isSender: isSender)));
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildTextWidget('${context.translation.site} : $site'),
|
|
|
|
|
_buildTextWidget('${context.translation.unite} : $unit'),
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider(color: Color(0xFFEAF1F4), height: 1, thickness: 1),
|
|
|
|
|
8.height,
|
|
|
|
|
_buildTextWidget(comment),
|
|
|
|
|
).onPress(isSender
|
|
|
|
|
? () {
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model, isSender: isSender)));
|
|
|
|
|
}
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model, isSender: isSender)));
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
_buildTextWidget('${context.translation.site} : $site'),
|
|
|
|
|
_buildTextWidget('${context.translation.unite} : $unit'),
|
|
|
|
|
if (comment != null && comment.isNotEmpty) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider(color: Color(0xFFEAF1F4), height: 1, thickness: 1),
|
|
|
|
|
8.height,
|
|
|
|
|
_buildTextWidget(comment),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context).paddingOnly(top: 14, start: 14, end: 14);
|
|
|
|
|
).toShadowContainer(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int getIdstatus(String status) {
|
|
|
|
|
|