JonasWanke / timetable

📅 Customizable flutter calendar widget including day and week views
https://pub.dev/packages/timetable
Apache License 2.0
311 stars 80 forks source link

Working hours theming #26

Open TatsuUkraine opened 4 years ago

TatsuUkraine commented 4 years ago

I will start with a question) If this widget doesn't provide this functionality - I will convert it to feature request)

So the question is: Is it possible to style hour cells, or maybe add some overlay to the date column to highlight time ranges that are available for selection?

For instance, some business or person works on Monday from 9am till 6pm. And he has launch time from 1:30pm till 2pm. So I want to reflect that in the time table, by adding a grey background to all day, except range 9am-1:30pm and 2pm-6pm.

Thanks for the answer.

TatsuUkraine commented 4 years ago

here is a small example, that I took from a different library

example

JonasWanke commented 4 years ago

This currently isn't supported, but sounds like a useful feature! Do you have a link to that library? (I'm curious how their API for configuring this looks.)

Unfortunately, the exam period of my university starts very soon, so I don't know when I'll have the time to implement this.

TatsuUkraine commented 4 years ago

I took this photo from syncfusion_flutter_calendar , but im not sure that they have good API, for instance this greyed sectors is actually disabled areas. And I'm not sure that it's a right approach

TatsuUkraine commented 4 years ago

In my opinion better to have standalone builder for this kind of overlays. And make this non-working hours still available for selection. It will be much more useful, since in that case dev can decide on they're own, if they want to do anything, when selected dateTime (on background tap) is in this area or not

TatsuUkraine commented 4 years ago

Like an option API may look like eventProvider property, that also can work with date based stream or static array. And it can accept something similar to current Event object, with start and end date

TatsuUkraine commented 4 years ago

@JonasWanke I made smaaal PR with a proposal on how Overlay data can be provided. Please let me know what you think. https://github.com/TatsuUkraine/timetable/pull/3

TatsuUkraine commented 4 years ago

it doesn't have actual render implementation, just an interface with how data for overlays can be provided