From 8757ada33998447680a058d7645ada14b73a374e Mon Sep 17 00:00:00 2001 From: Liplum Date: Wed, 25 Oct 2023 13:48:18 +0800 Subject: [PATCH] exchange press and long press on timetable jump button --- lib/timetable/page/timetable.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/timetable/page/timetable.dart b/lib/timetable/page/timetable.dart index 4c3435043..2267acc6f 100644 --- a/lib/timetable/page/timetable.dart +++ b/lib/timetable/page/timetable.dart @@ -63,20 +63,20 @@ class _TimetableBoardPageState extends State { ], ), floatingActionButton: InkWell( - onLongPress: () { - final today = timetable.type.locate(DateTime.now()); - if ($currentPos.value != today) { - eventBus.fire(JumpToPosEvent(today)); + onLongPress: () async { + if ($displayMode.value == DisplayMode.weekly) { + await selectWeeklyTimetablePageToJump(); + } else { + await selectDailyTimetablePageToJump(); } }, child: AutoHideFAB( controller: scrollController, child: const Icon(Icons.undo_rounded), onPressed: () async { - if ($displayMode.value == DisplayMode.weekly) { - await selectWeeklyTimetablePageToJump(); - } else { - await selectDailyTimetablePageToJump(); + final today = timetable.type.locate(DateTime.now()); + if ($currentPos.value != today) { + eventBus.fire(JumpToPosEvent(today)); } }, ),