From d723b6bc16b7a781324c0b533ef14010a2268ce0 Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 Date: Mon, 23 Feb 2026 14:36:06 +0300 Subject: [PATCH] refresh screen after update data --- .../tm_module/gas_refill/gas_refill_details.dart | 11 ++++++++++- .../gas_refill/update_gas_refill_request.dart | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/modules/tm_module/gas_refill/gas_refill_details.dart b/lib/modules/tm_module/gas_refill/gas_refill_details.dart index 0b2a7090..8b7e0c03 100644 --- a/lib/modules/tm_module/gas_refill/gas_refill_details.dart +++ b/lib/modules/tm_module/gas_refill/gas_refill_details.dart @@ -141,7 +141,16 @@ class _GasRefillDetailsPageState extends State { 16.width, AppFilledButton( onPressed: () async { - await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateGasRefillRequest(gasRefillModel: _model))); + bool? isRefresh = await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateGasRefillRequest(gasRefillModel: _model)));; + if (isRefresh != null && isRefresh) { + Utils.showLoading(context); + await gasRefillProvider.getGasRefillObjectById(widget.model.id!); + isDataUpdated = true; + Utils.hideLoading(context); + setState(() {}); + // isDataUpdated = true; + // setState(() {}); + } // getVisitData(); }, label: context.translation.updateRequest, diff --git a/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart b/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart index 7f0fc8c3..66343d3d 100644 --- a/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart +++ b/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart @@ -192,8 +192,12 @@ class _UpdateGasRefillRequestState extends State { // when click complete then this request remove from the list and status changes to closed.. _gasRefillProvider?.reset(); allRequestsProvider.getAllRequests(context, typeTransaction: 2); + // Navigator.pop(context); + Navigator.pop(context,true); + }else{ + Navigator.pop(context,false); + } - Navigator.pop(context); } }); }