refactor home
This commit is contained in:
@@ -165,4 +165,27 @@ class HomeViewModel with ChangeNotifier {
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Calculation methods for progress bars
|
||||
double get partnershipCount {
|
||||
return tenderApprovalsStateResponse?.data?.partnershipCount?.toDouble() ??
|
||||
0.0;
|
||||
}
|
||||
|
||||
double get selfApplyCount {
|
||||
return tenderApprovalsStateResponse?.data?.selfApplyCount?.toDouble() ??
|
||||
0.0;
|
||||
}
|
||||
|
||||
double get totalCount {
|
||||
return partnershipCount + selfApplyCount;
|
||||
}
|
||||
|
||||
double get partnershipPercent {
|
||||
return totalCount > 0 ? (partnershipCount / totalCount) * 100 : 0;
|
||||
}
|
||||
|
||||
double get selfApplyPercent {
|
||||
return totalCount > 0 ? (selfApplyCount / totalCount) * 100 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user