This commit is contained in:
2024-12-22 02:32:40 +03:00
parent de1d6c85e5
commit 86e539daf1
38 changed files with 213 additions and 195 deletions

View File

@@ -18,7 +18,22 @@ class CalendarScheduleController extends GetxController {
loading = false.obs; update();
}
static void openScreen() async {
Get.to(() => const CalendarScreen());
static void openScreen() async { Get.to(() => const CalendarScreen()); }
void goToConcreteDay(DateTime day) async {
date = (day.copyWith(hour: 12, minute: 0, millisecond: 0, microsecond: 0)).obs;
loadSchedule(date.value);
}
void goToPrevDay() async {
if(date.value.isBefore(DateTime(2024, 8, 1, 23, 59))) return;
date = (date.value.copyWith().subtract(const Duration(days: 1)).copyWith(hour: 12, minute: 0)).obs;
loadSchedule(date.value);
}
void goToNextDay() async {
if(date.value.isAfter(DateTime(2025, 12, 31))) return;
date = (date.value.copyWith().add(const Duration(days: 1)).copyWith(hour: 12, minute: 0)).obs;
loadSchedule(date.value);
}
}

View File

@@ -1,5 +1,6 @@
import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:reverse_nn/application/services/schedule.dart';
@@ -12,6 +13,7 @@ class ScheduleController extends GetxController {
}
void updateCurrentSchedule() async {
if(kDebugMode) { log('update current status'); }
currentSchedule = (await ScheduleService().getCurrentStatus()).obs;
update();