✨ Fixes issue #331: Add auto-scroll to current time for Day, Week, and Multi-Day views#550
Open
lavigarg-simform wants to merge 1 commit into
Open
Conversation
5cc0298 to
371730f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in “auto scroll to current time” capability for the timeline-based calendar views (DayView, WeekView, MultiDayView), including new imperative APIs on the corresponding *ViewState classes and tests/docs/examples to demonstrate the behavior.
Changes:
- Introduces
scrollToCurrentTime(defaultfalse) on Day/Week/MultiDay views to auto-center the current time after initial layout. - Adds
ScrollToCurrentTimeMixinto share the time-to-offset math plusjumpToCurrentTime()/animateToCurrentTime()state APIs. - Adds widget tests and updates examples, documentation, and changelog to cover the new feature.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/scroll_to_current_time_test.dart | Adds widget tests for initial auto-centering and the new imperative APIs. |
| lib/src/scroll_to_current_time_mixin.dart | New shared mixin implementing current-time offset computation and scrolling helpers. |
| lib/src/day_view/day_view.dart | Adds scrollToCurrentTime flag and mixes in shared scroll-to-now functionality for DayView. |
| lib/src/week_view/week_view.dart | Adds scrollToCurrentTime flag and mixes in shared scroll-to-now functionality for WeekView. |
| lib/src/multi_day_view/multi_day_view.dart | Adds scrollToCurrentTime flag and mixes in shared scroll-to-now functionality for MultiDayView. |
| example/lib/widgets/day_view_widget.dart | Enables scrollToCurrentTime in the DayView example. |
| example/lib/widgets/week_view_widget.dart | Enables scrollToCurrentTime in the WeekView example. |
| example/lib/widgets/multi_day_view_widget.dart | Enables scrollToCurrentTime in the MultiDayView example. |
| doc/documentation.md | Documents the new scrollToCurrentTime parameter in usage snippets. |
| CHANGELOG.md | Notes the new parameter and state APIs in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d Multi-Day views
371730f to
8d6576b
Compare
kavantrivedi
approved these changes
Jun 18, 2026
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
This PR implements auto-scroll functionality for the Day, Week, and Multi-Day views to automatically scroll to the current time when the calendar is loaded or when the view is updated. This addresses the long-standing enhancement request from issue #331, where users requested the ability to have the widget automatically scroll and center the present time on the screen.
Changes Made
Existing Behavior
Previously, users had to manually scroll to find the current time on the calendar, which was inconvenient for quickly viewing what's happening at the present moment.
New Behavior
The calendar now automatically scrolls to and highlights the current time, providing a better user experience by immediately showing the present time context when the view loads.
Checklist
✨for features)docsand added dartdoc comments with///examplesordocsBreaking Change?
Related Issues
Closes #331