werner-scholtz / kalender

An elegantly crafted Flutter calendar UI package.
MIT License
93 stars 26 forks source link

Opportunity to set width for events #70

Closed GSFdev24 closed 5 months ago

GSFdev24 commented 5 months ago

Hello team,

i want ask you if there is the opportunity to set the width of the event when i add it on calendar, because in my case when there are many events in the same day ,I would prefer to view them next to each other and not one below the other because the first event that occupies all available width.

I always thank you for the work you do

Regards

werner-scholtz commented 5 months ago

Hi do you means something like this ? image

GSFdev24 commented 5 months ago

Hi do you means something like this ? image

yes, the example of events 612,610,611 under saturday 4 is perfect for week configuration, but i wish the same view when there is the one day configuration, and there are many events

werner-scholtz commented 5 months ago

You can use the EventGroupBasicLayoutDelegate for this

    CalendarWidget(
      calendarLayoutDelegates: CalendarLayoutDelegates(
        tileLayoutDelegate: ({
          required date,
          required endHour,
          required events,
          required heightPerMinute,
          required startHour,
        }) {
          return EventGroupBasicLayoutDelegate<Event>(
            events: events,
            date: date,
            heightPerMinute: heightPerMinute,
            startHour: startHour,
            endHour: endHour,
          );
        },
      ),
    );
GSFdev24 commented 5 months ago

You can use the EventGroupBasicLayoutDelegate for this

    CalendarWidget(
      calendarLayoutDelegates: CalendarLayoutDelegates(
        tileLayoutDelegate: ({
          required date,
          required endHour,
          required events,
          required heightPerMinute,
          required startHour,
        }) {
          return EventGroupBasicLayoutDelegate<Event>(
            events: events,
            date: date,
            heightPerMinute: heightPerMinute,
            startHour: startHour,
            endHour: endHour,
          );
        },
      ),
    );

Ok, Great it works perfectly, thanks