improvements

design_3.0_asset_delivery_module
WaseemAbbasi22 1 week ago
parent ac50236aa2
commit 415bdf18f1

@ -282,7 +282,6 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
void _loadInitialData() {
assetDeliveryProvider = Provider.of<AssetDeliveryProvider>(context, listen: false);
if (widget.assetDetailsModel != null) {
model = EndUserAssetDetailsModel.fromJson(
widget.assetDetailsModel!.toJson(),
@ -291,7 +290,9 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
model.assetDeliveryExternalDeliveryId = widget.tableId;
model.status = widget.assetDetailsModel?.status;
model.rejectionReason = widget.assetDetailsModel?.rejectionReason;
model.receivedQty = widget.assetDetailsModel?.receivedQty;
}
log('details ${model.toJson()}');
quantityController.text = model.rejectedQty != null ? model.rejectedQty.toString() : '';
descriptionController.text = model.description ?? '';
@ -309,6 +310,11 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
return false;
}
bool get _showReceivedQty {
if (_isAccessory && model.receivedQty != null) return true;
return false;
}
bool get _showRejectionReason {
if (_isAccessory) {
if (_isRejected) return true;
@ -358,6 +364,10 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
children: [
_statusDropdown(),
8.height,
if (_showReceivedQty) ...[
_receivedQtyField(),
8.height,
],
if (_showRejectedQty) ...[
_rejectedQtyField(),
8.height,
@ -420,6 +430,36 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
);
}
Widget _receivedQtyField() {
log('received qty ${model.receivedQty}');
return Container(
padding: const EdgeInsets.all(16),
width: double.infinity,
decoration: BoxDecoration(
color: AppColor.fieldBgColor(context),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Received Qty', style: AppTextStyles.textFieldLabelStyle),
4.height,
Text(model.receivedQty.toString(), style: AppTextStyles.textFieldLabelStyle),
],
),
);
AppTextFormField(
labelText: 'Received Quantity'.addTranslation,
initialValue: model.receivedQty.toString(),
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
showShadow: false,
enable: false,
style: Theme.of(context).textTheme.titleMedium,
);
}
Widget _rejectionReasonDropdown() {
return SingleItemDropDownMenu<Lookup, EndUserRejectionReasonLookupProvider>(
context: context,

@ -191,7 +191,7 @@ class _UpdateChildAssetViewState extends State<UpdateChildAssetView> {
8.height,
AppTextFormField(
labelText: 'Asset Name'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.assetName,
textAlign: TextAlign.center,
enable: false,
@ -202,7 +202,7 @@ class _UpdateChildAssetViewState extends State<UpdateChildAssetView> {
8.height,
AppTextFormField(
labelText: 'Model'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.model,
textAlign: TextAlign.center,
enable: false,
@ -213,7 +213,7 @@ class _UpdateChildAssetViewState extends State<UpdateChildAssetView> {
8.height,
AppTextFormField(
labelText: 'Manufacturer'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.manufacturer ?? '',
textAlign: TextAlign.center,
enable: false,

@ -234,7 +234,7 @@ class _UpdateParentAssetViewState extends State<UpdateParentAssetView> {
8.height,
AppTextFormField(
labelText: 'Asset Name'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.assetName,
textAlign: TextAlign.center,
enable: false,
@ -245,7 +245,7 @@ class _UpdateParentAssetViewState extends State<UpdateParentAssetView> {
8.height,
AppTextFormField(
labelText: 'Model'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.model,
textAlign: TextAlign.center,
enable: false,
@ -256,7 +256,7 @@ class _UpdateParentAssetViewState extends State<UpdateParentAssetView> {
8.height,
AppTextFormField(
labelText: 'Manufacturer'.addTranslation,
backgroundColor: AppColor.fieldBgColor(context),
// backgroundColor: AppColor.fieldBgColor(context),
initialValue: model.modelDefinition?.manufacturer ?? '',
textAlign: TextAlign.center,
enable: false,

Loading…
Cancel
Save