diff --git a/lib/views/pages/device_transfer/device_transfer_details.dart b/lib/views/pages/device_transfer/device_transfer_details.dart index 932c8afc..9290e58f 100644 --- a/lib/views/pages/device_transfer/device_transfer_details.dart +++ b/lib/views/pages/device_transfer/device_transfer_details.dart @@ -64,53 +64,52 @@ class _DeviceTransferDetailsState extends State { 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 { backgroundColor: AColors.getRequestStatusColor(getIdstatus(_model.senderMachineStatusName))) : null, ), + 8.height, // receiver card _buildCard( isSender: false, @@ -148,7 +148,7 @@ class _DeviceTransferDetailsState extends State { : null, ), ], - ), + ).paddingAll(16), ), ); } @@ -182,42 +182,39 @@ class _DeviceTransferDetailsState extends State { ], ), 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) { diff --git a/lib/views/pages/device_transfer/update_device_transfer.dart b/lib/views/pages/device_transfer/update_device_transfer.dart index 6b0347e6..a5aa5e2d 100644 --- a/lib/views/pages/device_transfer/update_device_transfer.dart +++ b/lib/views/pages/device_transfer/update_device_transfer.dart @@ -174,7 +174,6 @@ class _UpdateDeviceTransferState extends State { ), 8.height, ESignature( - title: "Signature", oldSignature: widget.isSender ? widget.model.senderEngSignature : widget.model.receiverEngSignature, newSignature: _signature, @@ -184,8 +183,6 @@ class _UpdateDeviceTransferState extends State { widget.isSender ? _formModel.senderEngSignature = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}" : _formModel.receiverEngSignature = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}"; - - base64Encode(signature); }, ), ], diff --git a/lib/views/pages/user/gas_refill/request_gas_refill.dart b/lib/views/pages/user/gas_refill/request_gas_refill.dart index 587aab03..5203eb07 100644 --- a/lib/views/pages/user/gas_refill/request_gas_refill.dart +++ b/lib/views/pages/user/gas_refill/request_gas_refill.dart @@ -181,6 +181,7 @@ class _RequestGasRefillState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SingleChildScrollView( + padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -196,8 +197,8 @@ class _RequestGasRefillState extends State { '${context.translation.quantity}: ${widget.gasRefillModel.gazRefillDetails[0].requestedQty}'.bodyText(context), '${context.translation.site}: ${widget.gasRefillModel.site.name}'.bodyText(context), ], - ).paddingAll(16), - 12.height, + ).toShadowContainer(context), + 8.height, AppTimer( label: context.translation.workingHours, timer: _formModel.timer, @@ -207,7 +208,7 @@ class _RequestGasRefillState extends State { return true; }, ), - 12.height, + 8.height, SingleItemDropDownMenu( context: context, title: context.translation.reportStatus, @@ -216,7 +217,7 @@ class _RequestGasRefillState extends State { _formModel.status = value; }, ), - 12.height, + 8.height, AppTextFormField( labelText: context.translation.deliveredQuantity, onSaved: (value) { @@ -226,7 +227,7 @@ class _RequestGasRefillState extends State { controller: _deliveredQuantityController, validator: (value) => Validator.isNumeric(value) ? null : "allow numbers only", ), - 12.height, + 8.height, /// TBD AppTextFormField( @@ -237,7 +238,7 @@ class _RequestGasRefillState extends State { onSaved: (value) {}, ), ], - ).toShadowContainer(context).paddingAll(16), + ), ).expanded, AppFilledButton( label: widget.gasRefillModel == null ? context.translation.submit : context.translation.update, diff --git a/lib/views/widgets/e_signature/e_signature.dart b/lib/views/widgets/e_signature/e_signature.dart index 86e40b5b..268009e7 100644 --- a/lib/views/widgets/e_signature/e_signature.dart +++ b/lib/views/widgets/e_signature/e_signature.dart @@ -1,6 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:signature/signature.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/text_extensions.dart'; @@ -15,6 +16,7 @@ class ESignature extends StatefulWidget { final Function(Uint8List) onSaved; final Function(Uint8List) onChange; final String title; + const ESignature({Key key, this.title, this.oldSignature, this.onSaved, this.onChange, this.newSignature}) : super(key: key); @override @@ -50,6 +52,7 @@ class _ESignatureState extends State { @override Widget build(BuildContext context) { + print(widget.oldSignature); return FormField(onSaved: (_) async { widget.onSaved(signature); }, builder: (FormFieldState state) { @@ -59,7 +62,7 @@ class _ESignatureState extends State { width: MediaQuery.of(context).size.width, padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight), decoration: BoxDecoration( - color: context.isDark?Theme.of(context).cardColor:Colors.white, + color: context.isDark ? Theme.of(context).cardColor : Colors.white, borderRadius: _editable ? const BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)) : BorderRadius.circular(10), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)], ), @@ -98,7 +101,7 @@ class _ESignatureState extends State { height: 135.toScreenHeight, width: MediaQuery.of(context).size.width, padding: const EdgeInsets.only(bottom: 8), - child: signature != null ? Image.memory(signature) : ImageLoader(boxFit: BoxFit.contain, url: widget.oldSignature), + child: signature != null ? Image.memory(signature) : ImageLoader(boxFit: BoxFit.contain, url: URLs.getFileUrl(widget.oldSignature)), ) : AbsorbPointer( absorbing: !_editable, diff --git a/lib/views/widgets/timer/app_timer.dart b/lib/views/widgets/timer/app_timer.dart index 04a7bc16..19291a42 100644 --- a/lib/views/widgets/timer/app_timer.dart +++ b/lib/views/widgets/timer/app_timer.dart @@ -108,7 +108,7 @@ class _AppTimerState extends State { height: 56.toScreenHeight, padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth), decoration: BoxDecoration( - color: context.isDark?AppColor.neutral50:Theme.of(context).cardColor, + color: context.isDark ? AppColor.neutral50 : Theme.of(context).cardColor, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)], ), @@ -125,7 +125,7 @@ class _AppTimerState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ (widget.label ?? "Timer").tinyFont(context), - value.bodyText(context).custom(color: AppColor.neutral50), + value.bodyText(context).custom(color: widget.enabled ? AppColor.neutral50 : AppColor.neutral20), ], ); },