|
|
|
|
@ -66,7 +66,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
allRequestsAndCount = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
allRequestsAndCount = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
} else {
|
|
|
|
|
allRequestsAndCount = null;
|
|
|
|
|
@ -101,7 +101,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
calendarRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
calendarRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isCalendarLoading = false;
|
|
|
|
|
@ -130,7 +130,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
response = await ApiManager.instance.post(URLs.getAllRequestsAndCount, body: body);
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
highPriorityRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
highPriorityRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isHighPriorityLoading = false;
|
|
|
|
|
@ -160,7 +160,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
overdueRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
overdueRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isOverdueLoading = false;
|
|
|
|
|
@ -191,7 +191,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
openRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
openRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isOpenLoading = false;
|
|
|
|
|
@ -221,7 +221,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
inProgressRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
inProgressRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isInProgressLoading = false;
|
|
|
|
|
@ -251,7 +251,7 @@ class AllRequestsProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
completedRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"]);
|
|
|
|
|
completedRequests = AllRequestsAndCount.fromJson(json.decode(response.body)["data"][0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
isCompleteLoading = false;
|
|
|
|
|
|