fix: Support for Dark Mode by removing hardcoded colors#22
Merged
ngocvuphan merged 2 commits intongocvuphan:mainfrom Feb 24, 2026
Merged
fix: Support for Dark Mode by removing hardcoded colors#22ngocvuphan merged 2 commits intongocvuphan:mainfrom
ngocvuphan merged 2 commits intongocvuphan:mainfrom
Conversation
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.
What does this PR do?
This PR fixes an issue where the date picker's text and navigation icons become completely unreadable when the parent application uses a Dark Theme.
The Problem
Currently, the package hardcodes
Colors.blackfor text styles (e.g.,theme.textTheme.bodySmall?.copyWith(color: Colors.black)) and relies on default unstyled colors for action icons. When the app switches to Dark Mode and the calendar background adapts to a darker color, the black text and icons blend into the background, making the UI unusable.The Solution
Colors.blackwiththeme.colorScheme.onSurface._iconWidgetmethod to fall back totheme.colorScheme.onSurfaceif no specific color is provided.Result
The
vph_web_date_pickernow natively respects the Material 3 Theme provided by the parent application. It automatically renders black text/icons in Light Mode and white/light gray text/icons in Dark Mode, ensuring perfect readability in all scenarios. No functional logic has been changed.