requester details improvement,

main_design2.1
Sikander Saleem 9 months ago
parent c8862bbb63
commit 5ce3018b6e

@ -73,16 +73,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
infoText(label:context.translation.extensionNo ,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.toFirstActionFormat),
const Divider().defaultStyle(context),
_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 ?? ""}'),
infoText(label:context.translation.extensionNo ,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.toFirstActionFormat),
if ((_model?.comment ?? "").isNotEmpty) ...[
8.height,
const Divider().defaultStyle(context),

@ -115,6 +115,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
context: context,
title: context.translation.destinationSite,
initialValue: _assetDestination?.site,
showAsBottomSheet: true,
onSelect: (value) {
_assetDestination.site = value;
_assetDestination.building = null;
@ -132,7 +133,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
title: context.translation.building,
initialValue: _assetDestination?.building,
enabled: _assetDestination?.site?.buildings?.isNotEmpty ?? false,
staticData: _assetDestination?.site?.buildings ?? [],
staticData: _assetDestination?.site?.buildings ?? [], showAsBottomSheet: true,
onSelect: (value) {
_assetDestination?.building = value;
_assetDestination?.floor = null;
@ -146,7 +147,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
title: context.translation.floor,
initialValue: _assetDestination?.floor,
enabled: _assetDestination?.building?.floors?.isNotEmpty ?? false,
staticData: _assetDestination?.building?.floors ?? [],
staticData: _assetDestination?.building?.floors ?? [], showAsBottomSheet: true,
onSelect: (value) {
_assetDestination?.floor = value;
_assetDestination?.department = null;
@ -159,7 +160,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
title: context.translation.department,
initialValue: _assetDestination?.department,
enabled: _assetDestination?.floor?.departments?.isNotEmpty ?? false,
staticData: _assetDestination?.floor?.departments ?? [],
staticData: _assetDestination?.floor?.departments ?? [], showAsBottomSheet: true,
onSelect: (value) {
_assetDestination?.department = value;
_assetDestination?.room = null;
@ -172,7 +173,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
title: context.translation.room,
initialValue: _assetDestination?.room,
enabled: _assetDestination?.department?.rooms?.isNotEmpty ?? false,
staticData: _assetDestination?.department?.rooms ?? [],
staticData: _assetDestination?.department?.rooms ?? [], showAsBottomSheet: true,
onSelect: (value) {
_assetDestination?.room = value;
setState(() {});

@ -107,16 +107,17 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
8.height,
context.translation.gasRefillRequest.heading5(context),
8.height,
infoText(label: context.translation.extensionNo, value: gasRefillModel.extensionNo),
infoText(label: context.translation.employeeId, value: gasRefillModel.employeeId),
infoText(label: context.translation.name, value: gasRefillModel.name),
infoText(label: context.translation.createdDate, value: gasRefillModel.createdDate.toFirstActionFormat),
const Divider().defaultStyle(context),
'${context.translation.gasRequest}: ${gasRefillModel.gazRefillDetails[0].gasType?.name}'.bodyText(context),
'${context.translation.cylinderType}: ${gasRefillModel.gazRefillDetails[0].cylinderType?.name}'.bodyText(context),
'${context.translation.cylinderSize}: ${gasRefillModel.gazRefillDetails[0].cylinderSize?.name}'.bodyText(context),
'${context.translation.site}: ${gasRefillModel.site?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context),
'${context.translation.department}: ${gasRefillModel.department?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context),
'${context.translation.requestNo}: ${gasRefillModel.gazRefillNo}'.bodyText(context),
infoText(label:context.translation.extensionNo ,value:gasRefillModel.extensionNo),
infoText(label:context.translation.employeeId ,value:gasRefillModel.employeeId),
infoText(label:context.translation.name ,value:gasRefillModel.name),
infoText(label:context.translation.createdDate ,value:gasRefillModel.createdDate.toFirstActionFormat),
const Divider().defaultStyle(context),
'${context.translation.requestedQuantity}: ${gasRefillModel.gazRefillDetails[0]?.requestedQty ?? 0}'.bodyText(context),
'${context.translation.deliveredQuantity}: ${gasRefillModel.gazRefillDetails[0]?.deliverdQty ?? 0}'.bodyText(context),
@ -224,13 +225,15 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
],
).toShadowContainer(context, padding: 0);
}
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);
}
}
}

Loading…
Cancel
Save