Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core, ui, localization): Add Poll attachment composer #2048

Merged
merged 31 commits into from
Dec 11, 2024

Conversation

xsahil03x
Copy link
Member

@xsahil03x xsahil03x commented Nov 12, 2024

This pull request introduces several new features and improvements related to polls in the stream_chat package. Key changes include adding methods for managing polls in channels, updating poll-related models, and enhancing the user interface for creating and displaying polls.

Poll Management in Channels

  • Added methods in Channel class to send, update, and delete polls. (packages/stream_chat/lib/src/client/channel.dart)

Poll Model Updates

  • Introduced _NullConst class for handling nullable fields in Poll and PollOption classes. (packages/stream_chat/lib/src/core/models/poll.dart, packages/stream_chat/lib/src/core/models/poll_option.dart) [1] [2]
  • Changed default value of enforceUniqueVote to true in Poll class. (packages/stream_chat/lib/src/core/models/poll.dart, packages/stream_chat/lib/src/core/models/poll.g.dart) [1] [2]
  • Updated toJson methods to exclude null values for id fields in PollOption and PollVote classes. (packages/stream_chat/lib/src/core/models/poll_option.g.dart, packages/stream_chat/lib/src/core/models/poll_vote.g.dart) [1] [2]

User Interface Enhancements

  • Added StreamPollCreator widget for creating polls within the message input attachment picker. (packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_poll_creator.dart)
  • Enhanced StreamUnreadIndicator to use Badge widget for displaying unread counts. (packages/stream_chat_flutter/lib/src/indicators/unread_indicator.dart)

Localization and Permission Updates

  • Added multiple new localization strings related to poll creation and validation. (packages/stream_chat_flutter/lib/src/localization/translations.dart) [1] [2]
  • Introduced a new permission type sendPoll in PermissionType class. (packages/stream_chat/lib/src/permission_type.dart)

@xsahil03x xsahil03x force-pushed the feat/message-polls-apis branch from 2d429da to f9e7664 Compare December 9, 2024 13:54
…at/polls-attachment-composer

# Conflicts:
#	packages/stream_chat/lib/src/core/models/poll.dart
#	packages/stream_chat/lib/src/core/models/poll.g.dart
#	packages/stream_chat/lib/src/core/models/poll_option.dart
#	packages/stream_chat/lib/src/core/models/poll_option.g.dart
#	packages/stream_chat/lib/src/core/models/poll_vote.dart
#	packages/stream_chat/lib/src/core/models/poll_vote.g.dart
#	packages/stream_chat/lib/src/event_type.dart
@xsahil03x xsahil03x marked this pull request as ready for review December 9, 2024 13:59
@xsahil03x xsahil03x force-pushed the feat/message-polls-apis branch 3 times, most recently from 6ce3523 to f9c7890 Compare December 10, 2024 12:25
Base automatically changed from feat/message-polls-apis to master December 10, 2024 12:30
…nt-composer

# Conflicts:
#	packages/stream_chat/lib/src/core/models/poll.dart
#	packages/stream_chat/lib/src/core/models/poll.g.dart
#	packages/stream_chat/lib/src/core/models/poll_option.dart
#	packages/stream_chat/lib/src/core/models/poll_option.g.dart
#	packages/stream_chat/lib/src/core/models/poll_vote.dart
#	packages/stream_chat/lib/src/core/models/poll_vote.g.dart
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 70.40905% with 340 lines in your changes missing coverage. Please review.

Project coverage is 61.04%. Comparing base (d2d5ac9) to head (395d6ec).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...chat_flutter/lib/src/theme/poll_creator_theme.dart 21.84% 93 Missing ⚠️
...ut/attachment_picker/stream_attachment_picker.dart 1.47% 67 Missing ⚠️
...ib/src/poll/poll_option_reorderable_list_view.dart 59.22% 42 Missing ⚠️
...er/lib/src/message_input/stream_message_input.dart 0.00% 29 Missing ⚠️
...attachment_picker/options/stream_poll_creator.dart 0.00% 23 Missing ⚠️
...utter/lib/src/poll/stream_poll_creator_dialog.dart 77.41% 21 Missing ⚠️
packages/stream_chat/lib/src/client/channel.dart 0.00% 13 Missing ⚠️
.../lib/src/misc/separated_reorderable_list_view.dart 58.33% 10 Missing ⚠️
...hat_flutter/lib/src/localization/translations.dart 73.91% 6 Missing ⚠️
..._picker/stream_attachment_picker_bottom_sheet.dart 0.00% 6 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2048      +/-   ##
==========================================
+ Coverage   60.30%   61.04%   +0.73%     
==========================================
  Files         326      336      +10     
  Lines       19074    20152    +1078     
==========================================
+ Hits        11502    12301     +799     
- Misses       7572     7851     +279     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xsahil03x xsahil03x requested a review from deven98 December 11, 2024 13:37
Copy link
Contributor

@deven98 deven98 left a comment

Choose a reason for hiding this comment

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

LGTM

@xsahil03x xsahil03x merged commit bd684f2 into master Dec 11, 2024
14 checks passed
@xsahil03x xsahil03x deleted the feat/polls-attachment-composer branch December 11, 2024 14:10
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