Skip to content

Is there a way to have both dayDetectorBuilder without overriding the onDayTap? #398

Description

@linoqui14

My very goal is make a calendar (Day) where the passed time slot will have different color indicating that the time is already passed.
The screenshot bellow is the example of that.
Screenshot 2024-08-14 at 1 49 24 AM

I achived that using dayDetectorBuilder but it ovirrieden the onDayTap. I read the documentation and it says you will have your custom PressDetector

The problem is that the dayDetectorBuilder only returns a Date value without time so whenever I click to a time it will just show the Date.

Code

dayDetectorBuilder:({
     required DateTime date,
     required double height,
     required double heightPerMinute,
     required MinuteSlotSize minuteSlotSize,
     required double width,
   }) {
     var now = DateTime.now();
     bool isToday = date.compareWithoutTime(now);
     return Container(
       height:!isToday&&date.isBefore(now)?height: 
       isToday?(DateTime.now().difference(now.withoutTime).inMinutes) * heightPerMinute:0,
       color: BColors.blue.withAlpha(30),
   );
 },

Replicate:

  1. Create a DayView() with dayDetectorBuilder
  2. Add onDayTap()

If you have much better way to do this, please share it to me and I will try to implement it.
Thank you

Metadata

Metadata

Labels

priority:2Bug/Enhancement with priority level 2.questionFurther information is requestedwaiting-for-resoponseWaiting for someone to respond.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions