refresh screen after update data

design_3.0_demo_module
WaseemAbbasi22 4 weeks ago
parent c50e979790
commit d723b6bc16

@ -141,7 +141,16 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
16.width, 16.width,
AppFilledButton( AppFilledButton(
onPressed: () async { 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(); // getVisitData();
}, },
label: context.translation.updateRequest, label: context.translation.updateRequest,

@ -192,8 +192,12 @@ class _UpdateGasRefillRequestState extends State<UpdateGasRefillRequest> {
// when click complete then this request remove from the list and status changes to closed.. // when click complete then this request remove from the list and status changes to closed..
_gasRefillProvider?.reset(); _gasRefillProvider?.reset();
allRequestsProvider.getAllRequests(context, typeTransaction: 2); allRequestsProvider.getAllRequests(context, typeTransaction: 2);
// Navigator.pop(context);
Navigator.pop(context,true);
}else{
Navigator.pop(context,false);
} }
Navigator.pop(context);
} }
}); });
} }

Loading…
Cancel
Save