@ -89,7 +89,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
backgroundColor: AppColor . getRequestStatusColorByName ( context , _model ? . transferType ? . name ) ,
backgroundColor: AppColor . getRequestStatusColorByName ( context , _model ? . transferType ? . name ) ,
) ,
) ,
1. width . expanded ,
1. width . expanded ,
InfoDateWidget ( _model ? . created On ? . toString ( ) ? ? " " ) ,
InfoDateWidget ( _model ? . created Date ? . toString ( ) ? ? " " ) ,
] ,
] ,
) ,
) ,
8. height ,
8. height ,
@ -240,31 +240,38 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
) ,
) ,
if ( ( _userProvider ! . user ? . type = = UsersTypes . engineer ) )
if ( ( _userProvider ! . user ? . type = = UsersTypes . engineer ) )
if ( isCurrentEngineerEligibleForEdit & & isCurrentRequestEditAble )
if ( isCurrentEngineerEligibleForEdit & & isCurrentRequestEditAble )
" edit " . toSvgAsset ( height: 40, width: 40 ) . onPress ( ( ) async {
" edit _icon " . toSvgAsset ( height: 24, width: 24 , color: AppColor . icon2Color ( context ) ) . onPress ( ( ) async {
bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: true ) ) ) ) as bool ;
bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: true ) ) ) ) as bool ;
if ( isReload ? ? false ) {
if ( isReload ? ? false ) {
setState ( ( ) { } ) ;
setState ( ( ) { } ) ;
}
}
} ) ,
} ) ,
/ / " edit " . toSvgAsset ( height: 40 , width: 40 ) . onPress ( ( ) async {
/ / bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: true ) ) ) ) as bool ;
/ / if ( isReload ? ? false ) {
/ / setState ( ( ) { } ) ;
/ / }
/ / } ) ,
] ,
] ,
) ,
) ,
8. height ,
8. height ,
context . translation . workOrderDetails . heading5 ( context ) . custom ( color: AppColor . textStyleColor ( context ) ) ,
context . translation . workOrderDetails . heading5 ( context ) . custom ( color: AppColor . textStyleColor ( context ) ) ,
infoText ( label: context . translation . destinationSite , value: _model ? . senderSiteName ) ,
InfoTextWidge t( label: context . translation . destinationSite , value: _model ? . senderSiteName ) ,
/ / infoText ( label: " Sender Building " . addTranslation , value: _model ? . senderBuildingName ) ,
/ / infoText ( label: " Sender Building " . addTranslation , value: _model ? . senderBuildingName ) ,
/ / infoText ( label: " Sender Floor " . addTranslation , value: _model ? . senderFloorName ) ,
/ / infoText ( label: " Sender Floor " . addTranslation , value: _model ? . senderFloorName ) ,
/ / infoText ( label: " Sender Department " . addTranslation , value: _model ? . senderDepartmentName ) ,
/ / infoText ( label: " Sender Department " . addTranslation , value: _model ? . senderDepartmentName ) ,
infoTex t( label: " Building " . addTranslation , value: _model ? . destBuildingName ) ,
InfoTextWidge t( label: " Building " . addTranslation , value: _model ? . destBuildingName ) ,
infoTex t( label: " Floor " . addTranslation , value: _model ? . destFloorName ) ,
InfoTextWidge t( label: " Floor " . addTranslation , value: _model ? . destFloorName ) ,
infoTex t( label: " Department " . addTranslation , value: _model ? . destDepartmentName ) ,
InfoTextWidge t( label: " Department " . addTranslation , value: _model ? . destDepartmentName ) ,
if ( _model ! . senderComment ! = null & & _model ! . senderComment ! . isNotEmpty ) . . . [
if ( _model ! . senderComment ! = null & & _model ! . senderComment ! . isNotEmpty ) . . . [
8. height ,
const Divider ( ) . defaultStyle ( context ) ,
const Divider ( ) . defaultStyle ( context ) ,
Text (
InfoHeader16Widget ( " Technical Comments " . addTranslation ) ,
" Technical Comments " . addTranslation ,
/ / Text (
style: AppTextStyles . heading6 . copyWith ( color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ) ,
/ / " Technical Comments " . addTranslation ,
) ,
/ / style: AppTextStyles . heading6 . copyWith ( color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ) ,
_buildTextWidget ( _model ? . senderComment ? ? ' ' ) ,
/ / ) ,
InfoTextLabelWidget ( label: _model ? . senderComment ? ? ' ' ) ,
/ / _buildTextWidget ( _model ? . senderComment ? ? ' ' ) ,
] ,
] ,
if ( engineerCanAssignToHimself ) . . . [
if ( engineerCanAssignToHimself ) . . . [
@ -310,7 +317,8 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
{ required String site , String ? building , String ? dept , String ? floor , required String comment , required bool isSender , StatusLabel ? statusLabel , String ? assignTo } ) {
{ required String site , String ? building , String ? dept , String ? floor , required String comment , required bool isSender , StatusLabel ? statusLabel , String ? assignTo } ) {
bool isCurrentEngineerEligibleForEdit = isSender ? _model ? . senderAssignedEmployeeId = = _userProvider ! . user ? . userID : _model ? . receiverAssignedEmployeeId = = _userProvider ! . user ? . userID ;
bool isCurrentEngineerEligibleForEdit = isSender ? _model ? . senderAssignedEmployeeId = = _userProvider ! . user ? . userID : _model ? . receiverAssignedEmployeeId = = _userProvider ! . user ? . userID ;
bool isCurrentRequestClosed = isSender ? ( ( _model ? . senderMachineStatusValue = = 3 | | _model ? . senderMachineStatusValue = = 5 ) ) : ( ( _model ? . receiverMachineStatusValue = = 3 | | _model ? . receiverMachineStatusValue = = 5 ) ) ;
bool isCurrentRequestClosed =
isSender ? ( ( _model ? . senderMachineStatusValue = = 3 | | _model ? . senderMachineStatusValue = = 5 ) ) : ( ( _model ? . receiverMachineStatusValue = = 3 | | _model ? . receiverMachineStatusValue = = 5 ) ) ;
bool isCurrentRequestOpen = isSender ? ( ( _model ? . senderMachineStatusValue = = 4 ) ) : ( ( _model ? . receiverMachineStatusValue = = 4 ) ) ;
bool isCurrentRequestOpen = isSender ? ( ( _model ? . senderMachineStatusValue = = 4 ) ) : ( ( _model ? . receiverMachineStatusValue = = 4 ) ) ;
bool isCurrentRequestInProgress = isSender ? ( ( _model ? . senderMachineStatusValue = = 1 ) ) : ( ( _model ? . receiverMachineStatusValue = = 1 ) ) ;
bool isCurrentRequestInProgress = isSender ? ( ( _model ? . senderMachineStatusValue = = 1 ) ) : ( ( _model ? . receiverMachineStatusValue = = 1 ) ) ;
@ -329,7 +337,8 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
children: [
children: [
statusLabel ? ? Container ( ) ,
statusLabel ? ? Container ( ) ,
if ( statusLabel ! = null ) 8. height ,
if ( statusLabel ! = null ) 8. height ,
isSender ? context . translation . senderDetails . heading5 ( context ) : context . translation . receiverDetails . heading5 ( context ) . custom ( color: AppColor . textStyleColor ( context ) ) ,
InfoHeader16Widget ( isSender ? context . translation . senderDetails : context . translation . receiverDetails ) ,
/ / isSender ? context . translation . senderDetails . heading5 ( context ) : context . translation . receiverDetails . heading5 ( context ) . custom ( color: AppColor . textStyleColor ( context ) ) ,
] ,
] ,
) . expanded ,
) . expanded ,
if ( context . userProvider . isEngineer | | context . userProvider . isNurse )
if ( context . userProvider . isEngineer | | context . userProvider . isNurse )
@ -349,27 +358,34 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
/ / ? ( ! ( _model ? . senderMachineStatusName ? . toLowerCase ( ) ? . contains ( " close " ) ? ? false ) & & ! ( _model ? . senderMachineStatusName ? . toLowerCase ( ) ? . contains ( " complete " ) ? ? false ) )
/ / ? ( ! ( _model ? . senderMachineStatusName ? . toLowerCase ( ) ? . contains ( " close " ) ? ? false ) & & ! ( _model ? . senderMachineStatusName ? . toLowerCase ( ) ? . contains ( " complete " ) ? ? false ) )
/ / : ( ! ( _model ? . receiverMachineStatusName ? . toLowerCase ( ) ? . contains ( " close " ) ? ? false ) & & ! ( _model ? . receiverMachineStatusName ? . toLowerCase ( ) ? . contains ( " complete " ) ? ? false ) ) )
/ / : ( ! ( _model ? . receiverMachineStatusName ? . toLowerCase ( ) ? . contains ( " close " ) ? ? false ) & & ! ( _model ? . receiverMachineStatusName ? . toLowerCase ( ) ? . contains ( " complete " ) ? ? false ) ) )
/ /
/ /
" edit " . toSvgAsset ( height: 48, width: 48 ) . onPress ( ( ) async {
" edit _icon " . toSvgAsset ( height: 24, width: 24 , color: AppColor . icon2Color ( context ) ) . onPress ( ( ) async {
bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: isSender ) ) ) ) as bool ;
bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: isSender ) ) ) ) as bool ;
if ( isReload ? ? false ) {
if ( isReload ? ? false ) {
setState ( ( ) { } ) ;
setState ( ( ) { } ) ;
}
}
} ) ,
} ) ,
/ / " edit " . toSvgAsset ( height: 48 , width: 48 ) . onPress ( ( ) async {
/ / bool isReload = ( await Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( _ ) = > UpdateDeviceTransfer ( model: _model ! , isSender: isSender ) ) ) ) as bool ;
/ / if ( isReload ? ? false ) {
/ / setState ( ( ) { } ) ;
/ / }
/ / } ) ,
] ,
] ,
) ,
) ,
infoText ( label: context . translation . site , value: site ) ,
InfoTextWidge t( label: context . translation . site , value: site ) ,
infoText ( label: context . translation . building , value: building ) ,
InfoTextWidge t( label: context . translation . building , value: building ) ,
infoText ( label: context . translation . floor , value: floor ) ,
InfoTextWidge t( label: context . translation . floor , value: floor ) ,
infoText ( label: context . translation . department , value: dept ) ,
InfoTextWidge t( label: context . translation . department , value: dept ) ,
infoTex t( label: context . translation . assignedTo , value: assignTo ) ,
InfoTextWidge t( label: context . translation . assignedTo , value: assignTo ) ,
if ( comment . isNotEmpty ) . . . [
if ( comment . isNotEmpty ) . . . [
8. height ,
const Divider ( ) . defaultStyle ( context ) ,
const Divider ( ) . defaultStyle ( context ) ,
Text (
InfoHeader16Widget ( " Technical Comments " . addTranslation ) ,
" Technical Comments " . addTranslation ,
InfoTextLabelWidget ( label: comment ) ,
style: AppTextStyles . heading6 . copyWith ( color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ) ,
/ / Text (
) ,
/ / " Technical Comments " . addTranslation ,
_buildTextWidget ( comment ) ,
/ / style: AppTextStyles . heading6 . copyWith ( color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ) ,
/ / ) ,
/ / _buildTextWidget ( comment ) ,
] ,
] ,
if ( engineerCanAssignToHimself ) . . . [
if ( engineerCanAssignToHimself ) . . . [
16. height ,
16. height ,
@ -416,12 +432,13 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
const Divider ( ) . defaultStyle ( context ) ,
const Divider ( ) . defaultStyle ( context ) ,
Text (
InfoHeader16Widget ( " Contact Info " . addTranslation ) ,
" Contact Info " . addTranslation ,
/ / Text (
style: AppTextStyles . heading6 . copyWith (
/ / " Contact Info " . addTranslation ,
color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ,
/ / style: AppTextStyles . heading6 . copyWith (
) ,
/ / color: context . isDark ? AppColor . neutral30 : AppColor . neutral50 ,
) ,
/ / ) ,
/ / ) ,
. . . _model ! . assetTransferContactPersons ! . asMap ( ) . entries . map ( ( entry ) {
. . . _model ! . assetTransferContactPersons ! . asMap ( ) . entries . map ( ( entry ) {
final index = entry . key ;
final index = entry . key ;
final person = entry . value ;
final person = entry . value ;
@ -430,12 +447,11 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
return Column (
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
const SizedBox ( height: 8 ) ,
InfoTextWidget ( label: context . translation . employeeId , value: person . employeeNumber ) ,
infoText ( label: context . translation . employeeId , value: person . employeeNumber ) ,
InfoTextWidget ( label: context . translation . name , value: person . employeeName ) ,
infoText ( label: context . translation . name , value: person . employeeName ) ,
InfoTextWidget ( label: context . translation . email , value: person . email ) ,
infoText ( label: context . translation . email , value: person . email ) ,
InfoTextWidget ( label: context . translation . phoneNumber , value: person . mobileNo ) ,
infoText ( label: context . translation . phoneNumber , value: person . mobileNo ) ,
InfoTextWidget ( label: context . translation . extensionNo , value: person . extension ) ,
infoText ( label: context . translation . extensionNo , value: person . extension ) ,
if ( ! isLast & & _model ! . assetTransferContactPersons ! . length > 1 ) const Divider ( ) . defaultStyle ( context ) ,
if ( ! isLast & & _model ! . assetTransferContactPersons ! . length > 1 ) const Divider ( ) . defaultStyle ( context ) ,
] ,
] ,
) ;
) ;
@ -445,15 +461,4 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
}
}
return const SizedBox ( ) ;
return const SizedBox ( ) ;
}
}
Widget infoText ( {
String ? label ,
String ? value ,
} ) {
if ( value = = null | | value . isEmpty ) {
return const SizedBox ( ) ;
} else {
return ' $ label : $ value ' . bodyText ( context ) ;
}
}
}
}