✨ Replace CalendarThemeProvider with ThemeData.extensions and unify color palette#549
Open
lavigarg-simform wants to merge 2 commits into
Open
✨ Replace CalendarThemeProvider with ThemeData.extensions and unify color palette#549lavigarg-simform wants to merge 2 commits into
lavigarg-simform wants to merge 2 commits into
Conversation
ef76a7b to
06b29c3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the package’s theming by removing the custom CalendarThemeProvider / CalendarThemeData layer and switching fully to Flutter’s ThemeData.extensions, while unifying the default color tokens into a single CalendarViewColors palette with light/dark sub-palettes. It also updates the example app to use a single palette source-of-truth and adds runtime theme-mode switching.
Changes:
- Replaced legacy theme provider/data + Light/Dark token classes with
ThemeExtension-based theming and a unifiedCalendarViewColorspalette. - Made
BuildContexttheme accessors brightness-aware when no extension is registered (light vs dark defaults). - Reworked the example app’s theming to use
AppColors+ aThemeControllerfor ThemeMode switching, and updated docs/changelog for the breaking migration.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/theme/week_view_theme_data.dart | Seed defaults from CalendarViewColors.light/dark instead of legacy token classes. |
| lib/src/theme/schedule_view_theme_data.dart | Introduces/updates ScheduleView theming with light/dark defaults seeded from unified palette. |
| lib/src/theme/multi_day_view_theme_data.dart | Seed defaults from CalendarViewColors.light/dark. |
| lib/src/theme/month_view_theme_data.dart | Seed defaults from unified palette; rename copyWith param to cellHighlightColor. |
| lib/src/theme/light_app_colors.dart | Removes legacy light token palette class. |
| lib/src/theme/day_view_theme_data.dart | Seed defaults from CalendarViewColors.light/dark. |
| lib/src/theme/dark_app_colors.dart | Removes legacy dark token palette class. |
| lib/src/theme/calendar_view_colors.dart | Adds unified raw design-token palette (light/dark sub-palettes + shared tokens). |
| lib/src/theme/calendar_theme_data.dart | Removes legacy CalendarThemeData wrapper. |
| lib/src/schedule_view/schedule_view.dart | Updates docs to describe ThemeData.extensions-based styling. |
| lib/src/extensions.dart | Makes theme accessors brightness-aware and removes the old multiDayViewTheme accessor extension. |
| lib/src/calendar_theme_provider.dart | Removes legacy CalendarThemeProvider InheritedWidget. |
| lib/calendar_view.dart | Updates public exports to drop legacy theming types. |
| example/lib/widgets/week_view_widget.dart | Simplifies time-slot color logic (removes weekend special-case). |
| example/lib/widgets/day_view_widget.dart | Migrates example usage from provider-based theme lookup to context.dayViewColors. |
| example/lib/widgets/calendar_configs.dart | Reworks settings UI to use themed dropdowns + ThemeController ThemeMode selection. |
| example/lib/theme/theme_controller.dart | Adds ThemeController (InheritedNotifier) to drive runtime ThemeMode switching. |
| example/lib/theme/dark_app_colors.dart | Removes legacy example dark palette class. |
| example/lib/theme/app_theme.dart | Rebuilds example ThemeData around AppColors.light/dark and registers calendar ThemeExtensions on both themes. |
| example/lib/theme/app_theme_extension.dart | Updates example ThemeExtension to seed from AppColors.light/dark instead of a separate dark palette. |
| example/lib/theme/app_colors.dart | Consolidates example palette into AppColors.light/dark plus shared accent constants. |
| example/lib/pages/web/web_home_page.dart | Removes old boolean dark-mode callback wiring. |
| example/lib/pages/mobile/mobile_home_page.dart | Replaces boolean dark-mode toggle with a themed ThemeMode selection dialog. |
| example/lib/pages/home_page.dart | Removes old theme callback plumbing; pages now rely on ThemeController. |
| example/lib/main.dart | Rewires app composition to use ThemeController and a stable EventController. |
| example/lib/l10n/app_es.arb | Updates strings for ThemeMode selection UI (system/light/dark). |
| example/lib/l10n/app_en.arb | Updates strings for ThemeMode selection UI (system/light/dark). |
| example/lib/l10n/app_ar.arb | Updates strings for ThemeMode selection UI (system/light/dark). |
| example/lib/extension.dart | Makes example context.appColors brightness-aware when no extension is registered. |
| example/lib/constants.dart | Updates constants to reference the new AppColors.light palette values. |
| doc/documentation.md | Updates theming documentation and adds migration guidance for removed provider/accessors. |
| CHANGELOG.md | Records breaking theming changes and API renames for the upcoming release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
06b29c3 to
713063d
Compare
kavantrivedi
approved these changes
Jun 11, 2026
…lization, and theming
f456092 to
dc7f19b
Compare
…olor palette Removes CalendarThemeProvider and CalendarThemeData in favor of standard ThemeData.extensions, unifies all color tokens into a single CalendarViewColors palette (with matched light/dark sub-palettes), and makes all five BuildContext theme accessors brightness-aware. Adds ScheduleView theming, updates the example app to drive all calendar and chrome colors from a single AppColors source of truth, and introduces runtime theme-mode switching via ThemeController.
713063d to
e4773f9
Compare
dc7f19b to
99f57a1
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
This PR removes
CalendarThemeProviderandCalendarThemeDatain favour ofFlutter's standard
ThemeData.extensionsmechanism, unifying all package colortokens into a single
CalendarViewColorspalette (with matchinglightanddarksub-palettes).What changed:
CalendarThemeProviderandCalendarThemeDataare deleted. Calendar themesare now injected and read exclusively via
ThemeData.extensions.CalendarViewColorstoken palette replaces the separateLightAppColors/DarkAppColorsclasses. Each…ViewThemeDataseeds its.light()and.dark()constructors from the shared palette.BuildContexttheme accessors (context.dayViewColors,context.weekViewColors,context.monthViewColors,context.multiDayViewColors,context.scheduleViewColors) are nowbrightness-aware: they fall back to
.dark()defaults when the ambientThemebrightness is dark and no extension is registered (previously alwaysfell back to
.light()).ScheduleViewThemeDatais introduced with fulllight/dark/copyWith/lerp/mergesupport.AppColorssource-of-truth palette and a new
ThemeController(InheritedNotifier)for runtime theme-mode switching.
Existing behaviour that changes:
Apps using
darkThemewithout registering calendarThemeExtensionswill nowreceive dark-palette calendar defaults instead of light ones. To preserve
customisations in both modes, register extensions on both
themeanddarkTheme— see the updated setup example indoc/documentation.md.Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Migration instructions
1. Remove
CalendarThemeProvider2. Rename multiDayViewTheme → multiDayViewColors
3. Register extensions on darkTheme too
The theme accessors now honour dark-mode brightness. Any app setting
darkTheme: should register the calendar extensions there as well:
Related Issues
None
UI Screenshots
Updated UI for the example app home page in mobile and web view