Add ButtonStyle customization for OK and Cancel buttons#96
Merged
Conversation
This commit adds support for custom ButtonStyle properties to the ColorPickerActionButtons class, allowing developers to fully customize the appearance of the OK and Cancel dialog action buttons. New properties: - dialogOkButtonStyle: Optional ButtonStyle for the OK button - dialogCancelButtonStyle: Optional ButtonStyle for the Cancel button These styles override the default theme styling for the button type, enabling customization of foreground color, background color, padding, elevation, shape, and other button style properties. This addresses issue #95 by providing a flexible way to customize button appearance without needing to wrap the picker in a Theme widget. Usage example: ```dart ColorPickerActionButtons( dialogOkButtonType: ColorPickerActionButtonType.elevated, dialogOkButtonStyle: ElevatedButton.styleFrom( foregroundColor: Colors.white, backgroundColor: Colors.blue, ), dialogCancelButtonStyle: TextButton.styleFrom( foregroundColor: Colors.red, ), ) ``` Tests: Added comprehensive unit tests for ButtonStyle functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #96 +/- ##
==========================================
+ Coverage 90.95% 91.06% +0.11%
==========================================
Files 24 24
Lines 2354 2384 +30
==========================================
+ Hits 2141 2171 +30
Misses 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This commit adds support for custom ButtonStyle properties to the ColorPickerActionButtons class, allowing developers to fully customize the appearance of the OK and Cancel dialog action buttons.
New properties:
These styles override the default theme styling for the button type, enabling customization of foreground color, background color, padding, elevation, shape, and other button style properties.
This addresses issue #95 by providing a flexible way to customize button appearance without needing to wrap the picker in a Theme widget.
Usage example:
Tests: Added comprehensive unit tests for ButtonStyle functionality
Note
Adds optional dialogOkButtonStyle and dialogCancelButtonStyle to ColorPickerActionButtons and applies them to dialog buttons.
lib/src/models/color_picker_action_buttons.dart):dialogOkButtonStyleanddialogCancelButtonStyleButtonStyle?properties.copyWith,==,hashCode, anddebugFillPropertiesto include new fields.lib/src/color_picker.dart):actionButtons.dialogOkButtonStyle/dialogCancelButtonStyleto all dialog button variants (TextButton,OutlinedButton,ElevatedButton,FilledButton,FilledButton.tonal).test/color_picker_action_buttons_test.dart):toStringtest to check key substrings and update constants where appropriate.Written by Cursor Bugbot for commit 381e44e. This will update automatically on new commits. Configure here.