From 4ba30145efcb38759aab17ab07b3b397e23f7033 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Thu, 19 Jun 2025 12:32:35 +0530 Subject: [PATCH] feat: Update loading state initialization and remove unused fetchProjects method --- .../dashboard/daily_task_controller.dart | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/controller/dashboard/daily_task_controller.dart b/lib/controller/dashboard/daily_task_controller.dart index be0f5e4..64dadd6 100644 --- a/lib/controller/dashboard/daily_task_controller.dart +++ b/lib/controller/dashboard/daily_task_controller.dart @@ -15,7 +15,7 @@ class DailyTaskController extends GetxController { DateTime? endDateTask; List dailyTasks = []; - final RxSet expandedDates = {}.obs; + final RxSet expandedDates = {}.obs; void toggleDate(String dateKey) { if (expandedDates.contains(dateKey)) { @@ -25,7 +25,7 @@ class DailyTaskController extends GetxController { } } - RxBool isLoading = false.obs; + RxBool isLoading = true.obs; Map> groupedDailyTasks = {}; @override void onInit() { @@ -35,7 +35,6 @@ class DailyTaskController extends GetxController { void _initializeDefaults() { _setDefaultDateRange(); - fetchProjects(); } void _setDefaultDateRange() { @@ -45,22 +44,6 @@ class DailyTaskController extends GetxController { log.i("Default date range set: $startDateTask to $endDateTask"); } - Future fetchProjects() async { - isLoading.value = true; - - final response = await ApiService.getProjects(); - isLoading.value = false; - - if (response?.isEmpty ?? true) { - log.w("No project data found or API call failed."); - return; - } - - projects = response!.map((json) => ProjectModel.fromJson(json)).toList(); - log.i("Projects fetched: ${projects.length} projects loaded."); - update(); - } - Future fetchTaskData(String? projectId) async { if (projectId == null) return;