refactor(ui): redesign and modernize poll creator components#2611
refactor(ui): redesign and modernize poll creator components#2611
Conversation
* Replace `PollSwitchListTile` and `PollSwitchTextField` with `PollConfigOption` for a card-style configuration UI. * Redesign `PollOptionListItem` to support both existing options and a dedicated "add option" button variant. * Integrate `StreamStepper` for managing maximum votes per person. * Replace custom `StreamPollTextField` with the standard `StreamTextInput` from `stream_core_flutter`. * Update `StreamPollCreatorThemeData` to use modernized sub-styles (`StreamPollConfigOptionStyle`, `StreamButtonThemeStyle`, and `StreamTextInputStyle`). * Improve poll option validation logic to handle duplicates and empty states more effectively. * Refresh `AlertDialog` styles within the poll creator to align with the new design language. * Update tests to reflect UI component changes and new finding logic. Note: Temporary dependency path update for `stream_core_flutter` in `melos.yaml` and `pubspec.yaml`.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v10.0.0 #2611 +/- ##
==========================================
Coverage ? 65.65%
==========================================
Files ? 426
Lines ? 26066
Branches ? 0
==========================================
Hits ? 17114
Misses ? 8952
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// | ||
| /// If `null`, the button is disabled. | ||
| /// Only used by the [addOption] constructor. | ||
| final VoidCallback? onPressed; |
There was a problem hiding this comment.
I would rename this to onAddOptionPressed to make it clear it's not for pressing on a regular option.
|
|
||
| final spacing = context.streamSpacing; | ||
|
|
||
| final effectiveTitleStyle = theme.headerTextStyle ?? defaults.headerTextStyle; |
There was a problem hiding this comment.
I would call this effectiveHeaderStyle
| const SizedBox(height: 32), | ||
| PollSwitchListTile( | ||
| SizedBox(height: spacing.xxl), | ||
| PollConfigOption( |
There was a problem hiding this comment.
These default options, is that something we want to make configurable?
There was a problem hiding this comment.
not really, they already are options right now and disabled by default.
…oll question text field
…ll-redesign # Conflicts: # packages/stream_chat_flutter/lib/stream_chat_flutter.dart
…ll-redesign # Conflicts: # packages/stream_chat_flutter/lib/src/poll/creator/poll_option_reorderable_list_view.dart # packages/stream_chat_flutter/lib/src/poll/creator/stream_poll_creator_dialog.dart # packages/stream_chat_flutter/test/src/poll/creator/poll_option_reorderable_list_view_test.dart
Description of the pull request
PollSwitchListTileandPollSwitchTextFieldwithPollConfigOptionfor a card-style configuration UI.PollOptionListItemto support both existing options and a dedicated "add option" button variant.StreamStepperfor managing maximum votes per person.StreamPollTextFieldwith the standardStreamTextInputfromstream_core_flutter.StreamPollCreatorThemeDatato use modernized sub-styles (StreamPollConfigOptionStyle,StreamButtonThemeStyle, andStreamTextInputStyle).AlertDialogstyles within the poll creator to align with the new design language.Screenshots / Videos