From a5985357914c59328c7547a629ee36c9ca43a88d Mon Sep 17 00:00:00 2001 From: Francesco Viggiano Date: Tue, 6 Sep 2022 11:08:29 +0200 Subject: [PATCH] Add onDateTap call to week and day views --- lib/src/day_view/_internal_day_view_page.dart | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/src/day_view/_internal_day_view_page.dart b/lib/src/day_view/_internal_day_view_page.dart index f72f6d2d..c7c691f9 100644 --- a/lib/src/day_view/_internal_day_view_page.dart +++ b/lib/src/day_view/_internal_day_view_page.dart @@ -70,6 +70,9 @@ class InternalDayViewPage extends StatelessWidget { /// Called when user long press on calendar. final DatePressCallback? onDateLongPress; + /// Called when user taps on calendar. + final DateTapCallback? onDateTap; + /// Defines size of the slots that provides long press callback on area /// where events are not there. final MinuteSlotSize minuteSlotSize; @@ -98,6 +101,7 @@ class InternalDayViewPage extends StatelessWidget { required this.verticalLineOffset, required this.onTileTap, required this.onDateLongPress, + required this.onDateTap, required this.minuteSlotSize, required this.scrollNotifier, }) : super(key: key); @@ -122,13 +126,13 @@ class InternalDayViewPage extends StatelessWidget { ), PressDetector( width: width, - height: height, - heightPerMinute: heightPerMinute, - date: date, - onDateTap: onDateTap, - onDateLongPress: onDateLongPress, - minuteSlotSize: minuteSlotSize, - ), + height: height, + heightPerMinute: heightPerMinute, + date: date, + onDateTap: onDateTap, + onDateLongPress: onDateLongPress, + minuteSlotSize: minuteSlotSize, + ), Align( alignment: Alignment.centerRight, child: EventGenerator(