✨ Add timeSlotColorBuilder in MultiDayView#536
Open
lavigarg-simform wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds timeSlotColorBuilder support to MultiDayView to match the existing DayView/WeekView API, enabling per-slot background coloring for business hours, blocked time, etc.
Changes:
- Exposes
timeSlotColorBuilderonMultiDayViewand wires it through to the internal page implementation. - Renders painted slot background layers in
InternalMultiDayViewPagewhen the builder is provided. - Updates the example and changelog to reflect the new capability.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/src/multi_day_view/multi_day_view.dart | Adds the public timeSlotColorBuilder parameter and passes it into the internal page. |
| lib/src/multi_day_view/_internal_multi_day_view_page.dart | Implements slot background painting for MultiDayView using TimeSlotBackgroundPainter. |
| example/lib/widgets/multi_day_view_widget.dart | Demonstrates usage of timeSlotColorBuilder in MultiDayView. |
| CHANGELOG.md | Notes MultiDayView support for timeSlotColorBuilder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
11b163b to
eb5eb28
Compare
eb5eb28 to
de39e80
Compare
de39e80 to
6f57e9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends the existing timeSlotColorBuilder feature (previously available only in DayView and WeekView) to MultiDayView, and extracts the duplicated slot-background building logic into a single shared TimeSlotBackgrounds widget used by all three calendar views.
Changes
Feature —
timeSlotColorBuilderinMultiDayViewMultiDayView(multi_day_view.dart): AddedtimeSlotColorBuilderparameter (TimeSlotColorBuilder?), threaded it through toInternalMultiDayViewPage.InternalMultiDayViewPage(_internal_multi_day_view_page.dart): Renders the slot-background layer inside the scrollableStackwhentimeSlotColorBuilderis non-null, producing one coloured column per visible day.timeSlotColorBuilderusage example to the demo app (highlights business hours, lunch breaks, and weekends).Refactor — Shared
TimeSlotBackgroundswidgetThe inline implementations of
_buildTimeSlotBackground(DayView),_buildWeekTimeSlotBackgrounds(WeekView), and_buildMultiDayTimeSlotBackgrounds(MultiDayView) were all functionally equivalent column-painting logic. They have been replaced with a single shared widget:TimeSlotBackgroundsadded to common_components.dart:List<DateTime> dates(one column per date), so it works for single-day and multi-column layouts.ClipRect + RepaintBoundaryto isolate repaints.Directionality) layout._buildTimeSlotBackground()now delegates toTimeSlotBackgrounds(dates: [widget.date], ...). Pre-existing unused extensions.dart import removed._buildWeekTimeSlotBackgrounds()now delegates toTimeSlotBackgrounds._buildMultiDayTimeSlotBackgrounds()now delegates toTimeSlotBackgrounds.Tests
MultiDayViewtest case that verifies:timeSlotColorBuilderis invoked for every slot on every visible day column (12 unique date-time slot starts for 3 days × 4 half-hour slots in a 9–11 window).TimeSlotBackgroundPainter(findsNWidgets(3)).MultiDayViewaligns page boundaries relative toDateTime.now().Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Closes #535