casvanluijtelaar / paged_vertical_calendar

A simple paginated framework for implementing calendar based interfaces.
Apache License 2.0
39 stars 33 forks source link

Add Gridview month layout option #32

Open ekuleshov-idexx opened 1 year ago

ekuleshov-idexx commented 1 year ago

First of all, thank you for an amazing component. It is easy to customize and working great on mobile platforms.

Unfortunately it is not ideal on desktop platforms, including web. Here is animation of the project's own example with a full-window widget running in a web browser. As you can see when changing window width scale individual day cells and instead of seeing more information on the screen you actually see less.

paged_vertical_calendar_resize

Currently I'm working around that by restricting max width for the widget, but it is not optimal because a lot of screen space stay unused.

It would be great to have some options to better support desktop platforms. Here is a few ideas:

Thank you

casvanluijtelaar commented 1 year ago

I'm trying to keep this a minimal framework. how you implement it in you app is up to you, width and height of this widget can be easily set like any other flutter widget, different day size / layout behavior can be changed by using a custom dayBuilder

ekuleshov-idexx commented 1 year ago

I'm trying to keep this a minimal framework. how you implement it in you app is up to you, width and height of this widget can be easily set like any other flutter widget, different day size / layout behavior can be changed by using a custom dayBuilder

@casvanluijtelaar I do agree and appreciate simplicity. I can mitigate "over-scaling" issue with individual day cells and individual month widget by restricting their width.

However that does not allow to alter the month-widget layout flow. So, I was hoping you could add some flexibility or additional options, so one could achieve layout like MacOS standard Calendar:

image

The infinite_scroll_pagination used to provide infinite scrolling does support GridView. So, it might be possible to use it to handle layout of the month widgets. Then each month will be a cell in the grid and user could simply specify how many columns to render for the grid. 1-column grid will be the same as the current list layout.

Another approach (probably less flexible) is to externalize/expose and generify the PagedChildBuilderDelegate<Month> used to build individual months and provide some groupBy criteria in the PagedVerticalCalendar. So, one could provide a custom PagedChildBuilderDelegate<Quarter> implementation that would render 4 months in the row.

BTW, will be also useful to make the _MonthView class public.

Thank you.

casvanluijtelaar commented 1 year ago

ah, I see, yes this should be a quite simple addition

ekuleshov-idexx commented 1 year ago

Would this be somewhat related to #33

The outer layout could control what decoration is done around every month and how individual months are laid down - like show multiple months in each row.