samderlust / calendar_day_view

MIT License
6 stars 11 forks source link

add columns in the same day #7

Closed ejmoedgardo closed 1 year ago

ejmoedgardo commented 1 year ago

I would like to know if there is the possibility of adding a functionality to the Flutter package, of placing 2 or more columns on the same day... As for example, I attached the photo

dia_colunmas

For example, it can apply to some appointments, and there are two or more rooms on the same day

samderlust commented 1 year ago

@ejmoedgardo which Dayview are you using? Are you using calendar_day_view?

ejmoedgardo commented 1 year ago

in_row_day_view_tab

samderlust commented 1 year ago

@ejmoedgardo Could you provide some example code? InRowCalendarDayView if the events are happen in same time range, i would be place next to each other. You can look at the example page

Screenshot 2023-06-08 at 4 11 08 PM
samderlust commented 1 year ago

@ejmoedgardo I see that your photo looks like a weekview rather than a DayView. which is not this package's purpose did you try https://pub.dev/packages/calendar_view

ejmoedgardo commented 1 year ago

Yes, I saw it and it's excellent, I just need to have the appointments in separate columns

For example: https://fullcalendar.io/docs/vertical-resource-standard-demo

samderlust commented 1 year ago

@ejmoedgardo I see what you're trying to do now. Currently the package doesn't support group by colum/ type. But for a work around you can try to use timeRowBuilder instead of itemBuilder in InRowCalendarDayView take a look at this code:

 child: InRowCalendarDayView<String>(
            timeRowBuilder: (context, constraints, p2) {
              return Container(
                constraints: constraints,
                child: Row(
                  children: [
                    Container(
                      width: constraints.maxWidth / 4,
                      color: getRandomColor(),
                    ),
                    Container(
                      width: constraints.maxWidth / 4,
                      color: getRandomColor(),
                    ),
                    Container(
                      width: constraints.maxWidth / 4,
                      color: getRandomColor(),
                    ),
                    Container(
                      width: constraints.maxWidth / 4,
                      color: getRandomColor(),
                    ),
                  ],
                ),
              );
            },
.....

You will have to manually place event into according column

simulator_screenshot_80FDBB90-E903-44C4-A132-6081F6AB52B3

ejmoedgardo commented 1 year ago

Thank you very much... it helped me... now I have to find a way for each box to detect the onclik, and know what time it is positioned, in order to assign the appointment