When log out, it keeps loading ,

On asset transfer, on complete & close , dont show edit button,
Signature issue on update asset.
On calendar weekly swipe data calling issue.
Also on monthly
main_design2.0
nextwo 2 years ago
parent 114a0b9e40
commit b295256d66

@ -91,6 +91,7 @@ class AppDrawer extends StatelessWidget {
userProvider.reset(); userProvider.reset();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop();
} }
}), }),
18.height, 18.height,

@ -10,6 +10,9 @@ import 'package:test_sa/models/device/asset.dart';
import 'package:test_sa/views/app_style/colors.dart'; import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart'; import 'package:test_sa/views/widgets/requests/request_status.dart';
import '../../../../models/device/asset_transfer.dart';
import '../../../../views/pages/device_transfer/device_transfer_details.dart';
class AssetItemView extends StatelessWidget { class AssetItemView extends StatelessWidget {
final RequestsDetails request; final RequestsDetails request;
final bool showShadow; final bool showShadow;
@ -25,10 +28,12 @@ class AssetItemView extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
StatusLabel(label: request.priority, textColor: AColors.getRequestStatusTextColorByName(request.priority), backgroundColor: AColors.getRequestStatusColorByName(request.priority)), if(request.priority != null)
StatusLabel(label: request.priority??"", textColor: AColors.getRequestStatusTextColorByName(request.priority), backgroundColor: AColors.getRequestStatusColorByName(request.priority)),
8.width, 8.width,
if(request.status != null)
StatusLabel( StatusLabel(
label: request.status, label: request.status??"",
textColor: AColors.getRequestStatusTextColorByName(request.status), textColor: AColors.getRequestStatusTextColorByName(request.status),
backgroundColor: AColors.getRequestStatusColorByName(request.status), backgroundColor: AColors.getRequestStatusColorByName(request.status),
), ),
@ -72,6 +77,8 @@ class AssetItemView extends StatelessWidget {
], ],
), ),
], ],
).toShadowContainer(context,showShadow: showShadow).onPress(() {}); ).toShadowContainer(context,showShadow: showShadow).onPress(() {
Navigator.of(context).push(MaterialPageRoute(builder: (_) => DeviceTransferDetails(model: AssetTransfer(id: request.id))));
});
} }
} }

@ -76,10 +76,10 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildTextWidget('${context.translation.assetName} : ${_model.assetName}'), _buildTextWidget('${context.translation.assetName} : ${_model?.assetName ??""}'),
_buildTextWidget('${context.translation.assetNumber} : ${_model.assetNumber}'), _buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber??""}'),
_buildTextWidget('${context.translation.model} : ${_model.modelName}'), _buildTextWidget('${context.translation.model} : ${_model?.modelName??""}'),
_buildTextWidget('${context.translation.sn} : ${_model.assetSerialNo}'), _buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo??""}'),
], ],
), ),
8.height, 8.height,
@ -104,7 +104,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
// ], // ],
// ), // ),
1.width, 1.width,
Text(_model.createdOn != null ? _model.createdOn.toServiceRequestCardFormat : "", Text(_model?.createdOn != null ? _model.createdOn.toServiceRequestCardFormat : "",
textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : Color(0xFF3B3D4A))), textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : Color(0xFF3B3D4A))),
], ],
), ),
@ -114,17 +114,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
// sender card // sender card
_buildCard( _buildCard(
isSender: true, isSender: true,
site: _model.senderSiteName ?? "", site: _model?.senderSiteName ?? "",
/// TBD /// TBD
unit: _model.senderDepartmentName ?? "", unit: _model?.senderDepartmentName ?? "",
comment: _model.senderComment ?? "", comment: _model?.senderComment ?? "",
/// TBD /// TBD
statusLabel: _model.senderMachineStatusName != null statusLabel: _model?.senderMachineStatusName != null
? StatusLabel( ? StatusLabel(
label: _model.senderMachineStatusName, label: _model?.senderMachineStatusName,
id: _model.senderMachineStatusId, id: _model?.senderMachineStatusId,
textColor: AColors.getRequestStatusTextColor(getIdstatus(_model.senderMachineStatusName)), textColor: AColors.getRequestStatusTextColor(getIdstatus(_model.senderMachineStatusName)),
backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.senderMachineStatusName))) backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.senderMachineStatusName)))
: null, : null,
@ -132,17 +132,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
// receiver card // receiver card
_buildCard( _buildCard(
isSender: false, isSender: false,
site: _model.destSiteName ?? "", site: _model?.destSiteName ?? "",
/// TBD /// TBD
unit: _model.destDepartmentName ?? "", unit: _model?.destDepartmentName ?? "",
comment: _model.receiverComment ?? "", comment: _model?.receiverComment ?? "",
/// TBD /// TBD
statusLabel: _model.receiverMachineStatusName != null statusLabel: _model?.receiverMachineStatusName != null
? StatusLabel( ? StatusLabel(
label: _model.receiverMachineStatusName ?? "", label: _model?.receiverMachineStatusName ?? "",
id: _model.receiverMachineStatusId, id: _model?.receiverMachineStatusId,
textColor: AColors.getRequestStatusTextColor(getIdstatus(_model.receiverMachineStatusName)), textColor: AColors.getRequestStatusTextColor(getIdstatus(_model.receiverMachineStatusName)),
backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.receiverMachineStatusName))) backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.receiverMachineStatusName)))
: null, : null,
@ -181,8 +181,10 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context), isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context),
], ],
), ),
if ((_userProvider.user?.type == UsersTypes.engineer) && (isSender ? _model.senderMachineStatusName != "Closed" : _model.receiverMachineStatusName != "Closed")) if ((_userProvider.user?.type == UsersTypes.engineer))
CircleAvatar( if(isSender ? (_model?.senderMachineStatusName?.toLowerCase() != "closed" && _model?.senderMachineStatusName?.toLowerCase() != "completed")
: (_model?.receiverMachineStatusName?.toLowerCase() != "closed" && _model?.receiverMachineStatusName?.toLowerCase() != "completed"))
CircleAvatar(
radius: 25, radius: 25,
backgroundColor: AppColor.neutral30, backgroundColor: AppColor.neutral30,
child: CircleAvatar( child: CircleAvatar(

@ -174,6 +174,7 @@ class _UpdateDeviceTransferState extends State<UpdateDeviceTransfer> {
), ),
8.height, 8.height,
ESignature( ESignature(
title: "Signature", title: "Signature",
oldSignature: widget.isSender ? widget.model.senderEngSignature : widget.model.receiverEngSignature, oldSignature: widget.isSender ? widget.model.senderEngSignature : widget.model.receiverEngSignature,
newSignature: _signature, newSignature: _signature,

@ -38,6 +38,7 @@ class _ESignatureState extends State<ESignature> {
if (widget.newSignature != null) { if (widget.newSignature != null) {
signature = widget.newSignature; signature = widget.newSignature;
} }
super.initState(); super.initState();
} }
@ -92,7 +93,7 @@ class _ESignatureState extends State<ESignature> {
}), }),
], ],
), ),
(widget.oldSignature != null || signature != null || !_editable) ((widget.oldSignature != null || signature != null) && !_editable)
? Container( ? Container(
height: 135.toScreenHeight, height: 135.toScreenHeight,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,

Loading…
Cancel
Save