delete like from liked screens
This commit is contained in:
@@ -93,8 +93,8 @@ class TendersViewModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> getTenders() async {
|
||||
clearAll(); // Clear all data before fetching new tenders
|
||||
_isLoading = true;
|
||||
_errorMessage = null;
|
||||
_currentOffset = 0;
|
||||
_hasMoreData = true;
|
||||
notifyListeners();
|
||||
@@ -466,4 +466,33 @@ class TendersViewModel with ChangeNotifier {
|
||||
void updateHome() {
|
||||
_homeViewModel.init();
|
||||
}
|
||||
|
||||
/// Clear all feedbacks
|
||||
void clearFeedbacks() {
|
||||
feedbacks.clear();
|
||||
_feedbackData = null;
|
||||
_feedbackErrorMessage = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Clear all tenders
|
||||
void clearTenders() {
|
||||
_tendersResponse = null;
|
||||
_errorMessage = null;
|
||||
_currentOffset = 0;
|
||||
_hasMoreData = true;
|
||||
currentPage = 1;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Clear all data (tenders, feedbacks, and approvals)
|
||||
void clearAll() {
|
||||
clearTenders();
|
||||
clearFeedbacks();
|
||||
tenderApprovals.clear();
|
||||
_tenderApprovalData = null;
|
||||
_tenderApprovalToggleData = null;
|
||||
_tenderApprovalErrorMessage = null;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user