|
|
|
|
@ -149,10 +149,11 @@ class PpmProvider extends ChangeNotifier {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
Future<PlanPreventiveVisit?> getPlanPreventiveVisitById(int id) async {
|
|
|
|
|
// try {
|
|
|
|
|
try {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
Response response = await ApiManager.instance.get(URLs.getPlanPreventiveVisitById + "?planPreventiveVisitId=$id");
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
ppmPlanAttachments = [];
|
|
|
|
|
planPreventiveVisit = PlanPreventiveVisit.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
isLoading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
@ -161,11 +162,11 @@ class PpmProvider extends ChangeNotifier {
|
|
|
|
|
isLoading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return null;
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// isLoading= false;
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
} catch (error) {
|
|
|
|
|
isLoading= false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<int> updateVisitByEngineer({required int status}) async {
|
|
|
|
|
|