Skip to content

feat: add vertical week mode to WeekView for improved layout and scroll#546

Open
kavantrivedi wants to merge 1 commit into
masterfrom
feature/vertical_scroll_support
Open

feat: add vertical week mode to WeekView for improved layout and scroll#546
kavantrivedi wants to merge 1 commit into
masterfrom
feature/vertical_scroll_support

Conversation

@kavantrivedi

Copy link
Copy Markdown
Contributor

Description

This pull request introduces significant enhancements to the calendar view widgets, adding vertical scrolling modes for both month and week views, improving event form validation, and updating the example app to showcase these features. The changes are grouped below by theme.

Vertical Scrolling Modes for Calendar Views

  • Introduced MonthViewMode and WeekViewMode enums to control the scroll direction and layout behavior for MonthView and WeekView widgets, enabling both standard (horizontal) and vertical modes. [1] [2]
  • Updated MonthView and WeekView to accept new mode parameters, and adjusted their internal logic to handle vertical page scrolling and layout accordingly. This includes dynamic setting of PageView scroll direction and drag gesture handling. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Example App Updates

  • Modified the example app to demonstrate the new vertical modes: passed enableVerticalMonthMode and enableVerticalWeekMode flags to the respective widgets, and updated the UI to reflect the new behaviors. [1] [2] [3] [4] [5] [6] [7]
  • Added a custom titleStyle for demonstration in the home page.

Event Form Validation Improvements

  • Improved validation in the event creation form to ensure both start and end times are selected, and that end time is after start time for single-day events. Displays appropriate error messages using SnackBar.
  • Enhanced logic to keep single-day events aligned when only the start date is changed, and to update the UI correctly for recurring events. [1] [2]

Testing

  • Added a new test file week_view_vertical_mode_test.dart to verify correct behavior of the new vertical mode in WeekView, ensuring scroll direction and layout are as expected.…lling

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

#222

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new verticalWeek layout mode to WeekView (days fixed on the left, hours scrolling horizontally, weeks paging vertically) and a parallel verticalMonth mode to MonthView. The example app and a single widget test are updated to demonstrate/verify the new modes, and unrelated improvements are added to the example's add-event form (start/end-time validation and keeping single-day events aligned when the start date changes).

Changes:

  • Introduce WeekViewMode and MonthViewMode enums and propagate the new mode through WeekView/MonthView (page scroll axis, boundary drag detection, and a substantial new _buildVerticalWeekMode rendering path in InternalWeekViewPage).
  • Update example widgets/pages to opt into the new vertical modes and add a weekTitleHeight tweak.
  • Add add_event_form validation for incomplete/invalid start/end times and align end date when only the start date is changed; add week_view_vertical_mode_test.dart.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/src/week_view/week_view.dart Adds WeekViewMode enum, exposes weekViewMode, switches PageView axis, and adjusts page sizing for vertical mode.
lib/src/week_view/_internal_week_view_page.dart Adds full vertical-week rendering path: weekday/full-day columns, hour markers, day rows, live indicators, timeline band, and a compact event tile.
lib/src/month_view/month_view.dart Adds MonthViewMode enum and monthViewMode field; renames onHorizontalDragEnd to _onBoundaryDragEnd and supports vertical boundary drag detection.
example/lib/widgets/week_view_widget.dart Plumbs enableVerticalWeekMode and bumps weekTitleHeight.
example/lib/widgets/month_view_widget.dart Plumbs enableVerticalMonthMode to MonthView.
example/lib/widgets/calendar_views.dart Enables vertical modes by default in the demo.
example/lib/pages/week_view_page.dart Enables vertical week mode in the week-view demo page.
example/lib/widgets/add_event_form.dart Adds start/end-time presence and ordering validation; aligns end date with start date for single-day non-recurring events.
test/week_view_vertical_mode_test.dart New widget test asserting page scroll axis and presence of horizontal scroll view in vertical mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/src/month_view/month_view.dart
Comment thread test/week_view_vertical_mode_test.dart
Comment thread lib/src/week_view/_internal_week_view_page.dart Outdated
Comment thread lib/src/week_view/_internal_week_view_page.dart Outdated
Comment thread lib/src/month_view/month_view.dart Outdated
@kavantrivedi kavantrivedi force-pushed the feature/vertical_scroll_support branch from 1f8bf88 to 3746f5f Compare June 2, 2026 13:36
@kavantrivedi kavantrivedi requested a review from PRBaraiya June 2, 2026 13:37
@kavantrivedi kavantrivedi changed the title feat: add vertical week mode to WeekView for improved layout and scro… feat: add vertical week mode to WeekView for improved layout and scroll Jun 2, 2026
@kavantrivedi kavantrivedi force-pushed the feature/vertical_scroll_support branch from 3746f5f to 0b8cb30 Compare June 2, 2026 13:47
@kavantrivedi kavantrivedi marked this pull request as ready for review June 19, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants