feat: Update loading state initialization and remove unused fetchProjects method
This commit is contained in:
parent
d1305e1dba
commit
4ba30145ef
@ -15,7 +15,7 @@ class DailyTaskController extends GetxController {
|
||||
DateTime? endDateTask;
|
||||
|
||||
List<TaskModel> dailyTasks = [];
|
||||
final RxSet<String> expandedDates = <String>{}.obs;
|
||||
final RxSet<String> expandedDates = <String>{}.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<String, List<TaskModel>> 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<void> 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<void> fetchTaskData(String? projectId) async {
|
||||
if (projectId == null) return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user