From 3a9b2d46b85d22e8826c0f356ff4acdcc237330a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 4 May 2020 18:16:36 +0300 Subject: [PATCH] fix small bug --- lib/providers/patients_provider.dart | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 9b77c0e4..f207ee15 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -81,6 +81,13 @@ class PatientsProvider with ChangeNotifier { } } + setBasicData() { + isLoading = true; + isError = false; + error = ''; + notifyListeners(); + } + /* *@author: Elham Rababah *@Date:27/4/2020 @@ -89,8 +96,7 @@ class PatientsProvider with ChangeNotifier { *@desc: getPatientVitalSign */ getPatientVitalSign(patient) async { - isLoading = true; - notifyListeners(); + setBasicData(); try { if (await Helpers.checkConnection()) { @@ -143,8 +149,9 @@ class PatientsProvider with ChangeNotifier { *@desc: getLabResult Orders */ getLabResultOrders(patient) async { - isLoading = true; - notifyListeners(); + // isLoading = true; + // notifyListeners(); + setBasicData(); try { if (await Helpers.checkConnection()) { @@ -188,8 +195,9 @@ class PatientsProvider with ChangeNotifier { *@desc: getPatientPrescriptions */ getPatientPrescriptions(patient) async { - isLoading = true; - notifyListeners(); + // isLoading = true; + // notifyListeners(); + setBasicData(); try { if (await Helpers.checkConnection()) { @@ -234,8 +242,9 @@ class PatientsProvider with ChangeNotifier { *@desc: getPatientRadiology */ getPatientRadiology(patient) async { - isLoading = true; - notifyListeners(); + // isLoading = true; + // notifyListeners(); + setBasicData(); try { if (await Helpers.checkConnection()) { final response =