refactor home

This commit is contained in:
amirrezaghabeli
2025-08-27 13:22:35 +03:30
parent bcd499843b
commit dd46eb6054
12 changed files with 169 additions and 202 deletions
+23
View File
@@ -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;
}
}