From f74bb336425e1aa39abc89945c159a16b63bc36e Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 12 Feb 2024 20:28:10 +0530 Subject: [PATCH] Updated changelog --- packages/hms_room_kit/CHANGELOG.md | 15 +++++ packages/hms_room_kit/example/pubspec.lock | 4 +- .../poll_and_quiz_bottom_sheet.dart | 1 - .../bottom_sheets/poll_vote_bottom_sheet.dart | 8 ++- .../create_poll_form.dart | 1 - .../poll_quiz_selection_widget.dart | 2 + .../voting_flow_widgets/poll_result_card.dart | 6 +- .../voting_flow_widgets/poll_vote_card.dart | 8 ++- packages/hms_room_kit/pubspec.lock | 2 +- packages/hms_room_kit/pubspec.yaml | 3 +- packages/hmssdk_flutter/CHANGELOG.md | 28 +++++++++ .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 13 +--- packages/hmssdk_flutter/example/pubspec.lock | 9 ++- .../hmssdk_flutter/lib/hmssdk_flutter.dart | 1 - .../lib/src/enum/hms_poll_enum.dart | 6 ++ .../model/hms_message_result_listener.dart | 8 --- .../lib/src/model/polls/hms_poll.dart | 6 ++ .../lib/src/model/polls/hms_poll_answer.dart | 4 ++ .../model/polls/hms_poll_answer_response.dart | 2 + .../polls/hms_poll_interactivity_center.dart | 59 +++++++++++++++++++ .../src/model/polls/hms_poll_listener.dart | 11 ++++ .../src/model/polls/hms_poll_question.dart | 2 + .../model/polls/hms_poll_question_answer.dart | 1 + .../polls/hms_poll_question_builder.dart | 3 + .../model/polls/hms_poll_question_option.dart | 1 + .../model/polls/hms_poll_result_display.dart | 2 + .../model/polls/hms_poll_stats_question.dart | 2 + packages/hmssdk_flutter/pubspec.lock | 26 ++++---- 28 files changed, 185 insertions(+), 49 deletions(-) delete mode 100644 packages/hmssdk_flutter/lib/src/model/hms_message_result_listener.dart diff --git a/packages/hms_room_kit/CHANGELOG.md b/packages/hms_room_kit/CHANGELOG.md index 65fe7a865..e66819d5f 100644 --- a/packages/hms_room_kit/CHANGELOG.md +++ b/packages/hms_room_kit/CHANGELOG.md @@ -5,6 +5,21 @@ | hms_room_kit | [![Pub Version](https://img.shields.io/pub/v/hms_room_kit)](https://pub.dev/packages/hms_room_kit) | | hmssdk_flutter | [![Pub Version](https://img.shields.io/pub/v/hmssdk_flutter)](https://pub.dev/packages/hmssdk_flutter) | +## 1.0.12 - 2024-02-12 + +| Package | Version | +| -------------- | ------------------------------------------------------------------------------------------------------ | +| hms_room_kit | 1.0.12 | +| hmssdk_flutter | 1.9.9 | + +### 🚀 Added + +- Introducing polls on prebuilt + + Users can now create, manage, and stop polls directly from the prebuilt interface. + +Updated `hmssdk_flutter` package version to 1.9.9 + ## 1.0.11 - 2024-02-01 | Package | Version | diff --git a/packages/hms_room_kit/example/pubspec.lock b/packages/hms_room_kit/example/pubspec.lock index 7352b814c..b58cb43bc 100644 --- a/packages/hms_room_kit/example/pubspec.lock +++ b/packages/hms_room_kit/example/pubspec.lock @@ -214,14 +214,14 @@ packages: path: ".." relative: true source: path - version: "1.0.11" + version: "1.0.12" hmssdk_flutter: dependency: transitive description: path: "../../hmssdk_flutter" relative: true source: path - version: "1.9.8" + version: "1.9.9" http: dependency: transitive description: diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_and_quiz_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_and_quiz_bottom_sheet.dart index 5f533aed1..6d2350ce6 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_and_quiz_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_and_quiz_bottom_sheet.dart @@ -7,7 +7,6 @@ import 'package:tuple/tuple.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:hms_room_kit/src/model/poll_store.dart'; -import 'package:hms_room_kit/src/widgets/poll_widgets/poll_quiz_selection_widget.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_creation_widgets/poll_form.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_creation_widgets/poll_question_card.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_vote_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_vote_bottom_sheet.dart index 23baa70ac..281d4432f 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_vote_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/poll_vote_bottom_sheet.dart @@ -1,7 +1,12 @@ ///Dart imports import 'dart:math' as math; +///Package imports import 'package:flutter/material.dart'; +import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +import 'package:provider/provider.dart'; + +///Project imports import 'package:hms_room_kit/src/layout_api/hms_theme_colors.dart'; import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:hms_room_kit/src/model/poll_store.dart'; @@ -11,9 +16,8 @@ import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/live_badge.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/voting_flow_widgets/poll_result_card.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/voting_flow_widgets/poll_vote_card.dart'; -import 'package:hmssdk_flutter/hmssdk_flutter.dart'; -import 'package:provider/provider.dart'; +///[PollVoteBottomSheet] renders the voting bottom sheet for polls class PollVoteBottomSheet extends StatefulWidget { const PollVoteBottomSheet({super.key}); diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/create_poll_form.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/create_poll_form.dart index c51693fc4..daa7efc2f 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/create_poll_form.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/create_poll_form.dart @@ -1,6 +1,5 @@ ///Package imports import 'package:dropdown_button2/dropdown_button2.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_widget.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_widget.dart index bb6265822..5f86b1b4b 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_widget.dart @@ -1,7 +1,9 @@ +///Package imports import 'package:flutter/cupertino.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_quiz_selection_button.dart'; +///[PollQuizSelectionWidget] renders the widget for poll or quiz selection class PollQuizSelectionWidget extends StatefulWidget { const PollQuizSelectionWidget({super.key}); diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_result_card.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_result_card.dart index 7d268d42f..60b7f46f5 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_result_card.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_result_card.dart @@ -1,8 +1,12 @@ +///Package imports import 'package:flutter/material.dart'; +import 'package:hmssdk_flutter/hmssdk_flutter.dart'; + +///Project imports import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_subheading_text.dart'; -import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +///[PollResultCard] renders the results for polls class PollResultCard extends StatelessWidget { final int questionNumber; final int totalQuestions; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_vote_card.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_vote_card.dart index 1b33ffa3a..2d8e393a2 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_vote_card.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/voting_flow_widgets/poll_vote_card.dart @@ -1,12 +1,16 @@ +///Package imports import 'package:flutter/material.dart'; +import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +import 'package:provider/provider.dart'; + +///Project imports import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:hms_room_kit/src/model/poll_store.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_button.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_subheading_text.dart'; -import 'package:hmssdk_flutter/hmssdk_flutter.dart'; -import 'package:provider/provider.dart'; +///[PollVoteCard] renders the vote card for polls class PollVoteCard extends StatefulWidget { final int questionNumber; final int totalQuestions; diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index e2f2e76e2..8dfa22e8a 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -206,7 +206,7 @@ packages: path: "../hmssdk_flutter" relative: true source: path - version: "1.9.8" + version: "1.9.9" http: dependency: transitive description: diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index 91c72b7d5..b522541df 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -14,7 +14,8 @@ dependencies: flutter: sdk: flutter - hmssdk_flutter: 1.9.8 + hmssdk_flutter: + path: ../hmssdk_flutter intl: ^0.18.0 permission_handler: ^11.0.0 provider: ^6.0.5 diff --git a/packages/hmssdk_flutter/CHANGELOG.md b/packages/hmssdk_flutter/CHANGELOG.md index 611dd8110..d47ace539 100644 --- a/packages/hmssdk_flutter/CHANGELOG.md +++ b/packages/hmssdk_flutter/CHANGELOG.md @@ -5,6 +5,34 @@ | hms_room_kit | [![Pub Version](https://img.shields.io/pub/v/hms_room_kit)](https://pub.dev/packages/hms_room_kit) | | hmssdk_flutter | [![Pub Version](https://img.shields.io/pub/v/hmssdk_flutter)](https://pub.dev/packages/hmssdk_flutter) | +# 1.9.9 - 2024-02-12 + +| Package | Version | +| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| hms_room_kit | 1.0.12 | +| hmssdk_flutter | 1.9.9 | + +### ✨ Added + +- Introducing Polls + + - APIs for Comprehensive Poll Management: + - `quickStartPoll` to start polls + - `addSingleChoicePollResponse` & `addMultiChoicePollResponse` for adding single and multi choice response + - `stopPoll` to stop polls + + - Poll Update Listeners for Real-Time Notifications: + - Use `addPollUpdateListener` to start listening to poll updates + - Use `removePollUpdateListener` to stop listening to poll updates + + - Enhanced Poll Permissions within `HMSPermissions`: + - `pollRead` property ensures controlled read access to poll results and details. + - `pollWrite` property enables secure write access, allowing for poll creation and response submission. + +Updated to Android SDK 2.9.0 & iOS SDK 1.5.0 + +**Full Changelog**: [1.9.8...1.9.9](https://github.com/100mslive/100ms-flutter/compare/1.9.8...1.9.9) + # 1.9.8 - 2024-02-01 | Package | Version | diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 37a4810f9..8b76aca57 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -3,7 +3,6 @@ package live.hms.hmssdk_flutter import android.app.Activity import android.content.BroadcastReceiver import android.content.Context -import android.content.Context.* import android.content.Intent import android.content.IntentFilter import android.media.projection.MediaProjectionManager @@ -1578,11 +1577,7 @@ class HmssdkFlutterPlugin : private fun startScreenShare(result: Result) { androidScreenshareResult = result - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"), RECEIVER_EXPORTED) - }else { - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) - } + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) val mediaProjectionManager: MediaProjectionManager = activity.getSystemService( Context.MEDIA_PROJECTION_SERVICE, @@ -1647,11 +1642,7 @@ class HmssdkFlutterPlugin : ) { androidAudioShareResult = result mode = call.argument("audio_mixing_mode") - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"), RECEIVER_EXPORTED) - }else { - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"),) - } + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) val mediaProjectionManager: MediaProjectionManager? = activity.getSystemService( Context.MEDIA_PROJECTION_SERVICE, diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 1d288a2e7..848be1758 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -290,11 +290,10 @@ packages: hmssdk_flutter: dependency: transitive description: - name: hmssdk_flutter - sha256: ff1697824b42d31cb093fd4319c8fa3ba6872b7877707630062ed3cd9cf40813 - url: "https://pub.dev" - source: hosted - version: "1.9.8" + path: ".." + relative: true + source: path + version: "1.9.9" http: dependency: transitive description: diff --git a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart index 47d80e3ff..5ab479460 100644 --- a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart +++ b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart @@ -63,7 +63,6 @@ export 'src/model/hms_peer_removed_from_room.dart'; export 'src/model/hms_message_recipient.dart'; export 'src/model/hms_logs_listener.dart'; export 'src/model/hms_actions_result_listener.dart'; -export 'src/model/hms_message_result_listener.dart'; export 'src/enum/hms_action_result_listener_method.dart'; export 'src/model/hms_remote_peer.dart'; export 'src/model/hms_hls_config.dart'; diff --git a/packages/hmssdk_flutter/lib/src/enum/hms_poll_enum.dart b/packages/hmssdk_flutter/lib/src/enum/hms_poll_enum.dart index c39d8df0b..322137b9b 100644 --- a/packages/hmssdk_flutter/lib/src/enum/hms_poll_enum.dart +++ b/packages/hmssdk_flutter/lib/src/enum/hms_poll_enum.dart @@ -1,3 +1,4 @@ +///[HMSPollUserTrackingMode] is the mode based on which the app identifies the user enum HMSPollUserTrackingMode { user_id, peer_id, username } extension HMSPollUserTrackingModeValues on HMSPollUserTrackingMode { @@ -30,6 +31,7 @@ extension HMSPollUserTrackingModeValues on HMSPollUserTrackingMode { } } +///The [HMSPollCategory] enum categorizes whether a poll or quiz is being represented. enum HMSPollCategory { poll, quiz } extension HMSPollCategoryValues on HMSPollCategory { @@ -56,6 +58,7 @@ extension HMSPollCategoryValues on HMSPollCategory { } } +///[HMSPollQuestionType] enum categorizes the type of question enum HMSPollQuestionType { singleChoice, multiChoice, shortAnswer, longAnswer } extension HMSPollQuestionTypeValues on HMSPollQuestionType { @@ -92,6 +95,7 @@ extension HMSPollQuestionTypeValues on HMSPollQuestionType { } } +///[HMSPollState] enum represents the different states a poll can be in. enum HMSPollState { started, stopped, created } extension HMSPollStateValues on HMSPollState { @@ -122,6 +126,7 @@ extension HMSPollStateValues on HMSPollState { } } +///[HMSPollUpdateType] enum represents different types of updates that can occur in a poll. enum HMSPollUpdateType { started, stopped, resultsupdated } extension HMSPollUpdateTypeValues on HMSPollUpdateType { @@ -140,6 +145,7 @@ extension HMSPollUpdateTypeValues on HMSPollUpdateType { } } +///[HMSPollListenerMethod] contains the [HMSPollListener] methods enum HMSPollListenerMethod { onPollUpdate, unknown } extension HMSPollListenerMethodValues on HMSPollListenerMethod { diff --git a/packages/hmssdk_flutter/lib/src/model/hms_message_result_listener.dart b/packages/hmssdk_flutter/lib/src/model/hms_message_result_listener.dart deleted file mode 100644 index 1e33a3d28..000000000 --- a/packages/hmssdk_flutter/lib/src/model/hms_message_result_listener.dart +++ /dev/null @@ -1,8 +0,0 @@ -// Project imports: -import '../../hmssdk_flutter.dart'; - -abstract class HMSMessageResultListener { - void onSuccess({required HMSMessage hmsMessage}); - - void onError({HMSException? hmsException}); -} diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll.dart index da749e206..973a538fc 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll.dart @@ -1,7 +1,13 @@ +///Project imports import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:hmssdk_flutter/src/model/hms_date_extension.dart'; import 'package:hmssdk_flutter/src/model/polls/hms_poll_result_display.dart'; +///[HMSPoll] class represents poll +/// +///This class encapsulates various properties and methods related to a poll, including its ID, title, anonymity status, +///category (poll or quiz), creator, duration, user tracking mode, question count, questions, result display settings, +///roles that can view responses, roles that can vote, start time, starter, current state, stop time, and stopper. class HMSPoll { final String pollId; final String title; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer.dart index c45b24d7a..7e00f466c 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer.dart @@ -1,5 +1,7 @@ +///Project imports import 'package:hmssdk_flutter/src/enum/hms_poll_enum.dart'; +///[HMSPollAnswer] class represents answer to poll questions class HMSPollAnswer { final String? answerText; final Duration duration; @@ -21,6 +23,7 @@ class HMSPollAnswer { required this.update, }); + ///Method to get HMSPollAnswer from map factory HMSPollAnswer.fromMap(Map map) { return HMSPollAnswer( answerText: map['answer'], @@ -37,6 +40,7 @@ class HMSPollAnswer { ); } + ///Method to get map from HMSPollAnswer Object Map toMap() { return { 'answer': answerText, diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer_response.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer_response.dart index 2a275b9ab..88cc899cd 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer_response.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_answer_response.dart @@ -1,5 +1,7 @@ +///Project imports import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +///The[HMSPollAnswerResponse] class represents the poll answer class HMSPollAnswerResponse { final bool correct; final HMSException? error; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_interactivity_center.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_interactivity_center.dart index 215fab5fe..4e4c0e846 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_interactivity_center.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_interactivity_center.dart @@ -5,6 +5,9 @@ import 'package:hmssdk_flutter/src/service/platform_service.dart'; abstract class HMSPollInteractivityCenter { ///[addPollUpdateListener] adds the poll update listener to send ///the poll events to the application + ///**Parameters**: + /// + ///**listener** - [listener] static void addPollUpdateListener({required HMSPollListener listener}) { PlatformService.addPollUpdateListener(listener); } @@ -15,6 +18,19 @@ abstract class HMSPollInteractivityCenter { PlatformService.removePollUpdateListener(); } + ///[quickStartPoll] starts a quick poll with supplied arguments + /// + ///**Parameters**: + /// + ///**pollBuilder** - [pollBuilder] is an object of HMSPollBuilder containing the poll configurations + /// + ///**hmsActionResultListener** - [hmsActionResultListener] is a callback whose [HMSActionResultListener.onSuccess] will be called when the action completes successfully. + /// + ///**Returns** + /// + /// Future - A Future representing the asynchronous operation. It will return either null if the operation is successful, or an [HMSException] if an error occurs. + /// + ///Refer [Quick Start Poll](Add docs link here) static void quickStartPoll( {required HMSPollBuilder pollBuilder, required HMSActionResultListener? hmsActionResultListener}) async { @@ -22,6 +38,23 @@ abstract class HMSPollInteractivityCenter { arguments: {"poll_builder": pollBuilder.toMap()}); } + ///[addSingleChoicePollResponse] method is used to answer a single choice poll + /// + ///**Parameters** + /// + ///**hmsPoll** - [hmsPoll] object for the poll that is being answered + /// + ///**pollQuestion** - [pollQuestion] object for the question that is being answered + /// + ///**optionSelected** - [optionSelected] object for the option that is selected + /// + ///**peer** - [peer] who is answering the poll + /// + ///**Returns** + /// + /// Future - A Future representing the asynchronous operation. It will return either null if the operation is successful, or an [HMSException] if an error occurs. + /// + ///Refer [addSingleChoicePollResponse](Add docs link here) static Future addSingleChoicePollResponse( {required HMSPoll hmsPoll, required HMSPollQuestion pollQuestion, @@ -67,6 +100,17 @@ abstract class HMSPollInteractivityCenter { } } + /// [stopPoll] method is used to stop a poll. + /// + ///**Parameters** + /// + ///**poll** - [poll] object representing the poll to be stopped. + /// + ///**Returns** + /// + ///Future - A Future representing the asynchronous operation. It will return either null if the operation is successful, or an [HMSException] if an error occurs. + /// + ///Refer [stopPoll](Add docs link here) static Future stopPoll({required HMSPoll poll}) async { var result = await PlatformService.invokeMethod(PlatformMethod.stopPoll, arguments: {"poll_id": poll.pollId}); @@ -80,6 +124,19 @@ abstract class HMSPollInteractivityCenter { } } + ///[addMultiChoicePollResponse] method is used to answer a single choice poll + /// + ///**Parameters** + /// + ///**hmsPoll** - [hmsPoll] object for the poll that is being answered + /// + ///**pollQuestion** - [pollQuestion] object for the question that is being answered + /// + ///**optionsSelected** - [optionsSelected] list containing objects for the options selected + /// + ///**peer** - [peer] who is answering the poll + /// + ///Refer [addSingleChoicePollResponse](Add docs link here) static Future addMultiChoicePollResponse( {required HMSPoll hmsPoll, required HMSPollQuestion pollQuestion, @@ -128,6 +185,8 @@ abstract class HMSPollInteractivityCenter { } } +///[HMSPollBuilder] is used to create polls +///It contains getters and setters for poll builder properties class HMSPollBuilder { bool? _isAnonymous; Duration? _duration; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_listener.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_listener.dart index 0e8ed955e..28e7dc90f 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_listener.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_listener.dart @@ -1,7 +1,18 @@ +///Project imports import 'package:hmssdk_flutter/src/enum/hms_poll_enum.dart'; import 'package:hmssdk_flutter/src/model/polls/hms_poll.dart'; +///100ms HMSPollListener +/// +///[HMSPollListener] provides callback related to poll state changes. If the application uses polls and quizzes then it is required +///to implement [HMSPollListener] to get updates related to polls. abstract class HMSPollListener { + ///This is called whenever there are any changes related to the poll + ///i.e whether a poll is started or stopped or someone answered the poll + /// + /// - Parameters: + /// - poll: the poll object for which upgrade is triggered. + /// - pollUpdateType: pollUpdateType is an enum of [HMSPollUpdateType] void onPollUpdate( {required HMSPoll poll, required HMSPollUpdateType pollUpdateType}); } diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question.dart index 370044aaa..884abe105 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question.dart @@ -1,8 +1,10 @@ +///Project imports import 'package:hmssdk_flutter/src/enum/hms_poll_enum.dart'; import 'package:hmssdk_flutter/src/model/polls/hms_poll_answer.dart'; import 'package:hmssdk_flutter/src/model/polls/hms_poll_question_answer.dart'; import 'package:hmssdk_flutter/src/model/polls/hms_poll_question_option.dart'; +///[HMSPollQuestion] class represents poll question class HMSPollQuestion { final int questionId; final bool canSkip; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_answer.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_answer.dart index 55806ab3b..85891cdcd 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_answer.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_answer.dart @@ -1,3 +1,4 @@ +///[HMSPollQuestionAnswer] class represents the answer to poll questions class HMSPollQuestionAnswer { final bool hidden; final int? option; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_builder.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_builder.dart index 38f035917..a899f5c23 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_builder.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_builder.dart @@ -1,5 +1,8 @@ +///Project imports import 'package:hmssdk_flutter/src/enum/hms_poll_enum.dart'; +///[HMSPollQuestionBuilder] is used to create questions for polls +///It contains getters and setters for poll question builder properties class HMSPollQuestionBuilder { bool? _canSkip; bool? _canChangeResponse; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_option.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_option.dart index cb2be627c..f0db1d47d 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_option.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_question_option.dart @@ -1,3 +1,4 @@ +///[HMSPollQuestionOption] represents options for poll questions class HMSPollQuestionOption { final int index; final String? text; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_result_display.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_result_display.dart index a26b1f950..76d2ec2fd 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_result_display.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_result_display.dart @@ -1,5 +1,7 @@ +///Project imports import 'package:hmssdk_flutter/src/model/polls/hms_poll_stats_question.dart'; +///[HMSPollResultDisplay] class represents the poll results class HMSPollResultDisplay { final List? questions; final int? totalDistinctUsers; diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_stats_question.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_stats_question.dart index e57c53dbe..f84594044 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_stats_question.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_stats_question.dart @@ -1,5 +1,7 @@ +///Project imports import 'package:hmssdk_flutter/src/enum/hms_poll_enum.dart'; +///The [HMSPollStatsQuestion] class represents statistics for a single question in a poll. class HMSPollStatsQuestion { final int attemptedTimes; final int? correct; diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 53939cd59..c3cc2c33e 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.2" fake_async: dependency: transitive description: @@ -79,10 +79,10 @@ packages: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" path: dependency: transitive description: @@ -108,18 +108,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -140,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.1.4-beta" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0"