Skip to content

Commit

Permalink
Flut 210 (#1713)
Browse files Browse the repository at this point in the history
* Created extension for polls

* Added poll callbacks

* Added files for poll callbacks

* Updated release notes (#1694)

* Updated release notes

* Updated tag position

* Added image

* Update readme

* Updated links for sdk and prebuilt

* Updated links for sdk and prebuilt

* Fixed bugs

* 🤖 Automated Format and Fix

* released sample app version 1.5.124 (424) 🍀

* 🤖 Automated Format and Fix

* Updated changelog

* Updated pubspec

* 🤖 Automated Format and Fix

* Updated sdk version in room kit

* 🤖 Automated Format and Fix

* Updated changes

* updated changelog

* Completed poll parsing

* Added iOS implementation

* Added parsing in iOS

* Added create poll ui

* Added options  ui

* Added launch poll flow

* Added launch poll flow

* Added option to view previous polls

* released sample app version 1.5.132 (432) 🍀

* Added voting flow

* Refactored code

* Completed voting flow

* Added polls voted flow

* released sample app version 1.5.133 (433) 🍀

* updated gems

* updated supported version in app framework info.plist

* Added changes

* Fixed poll results issue

* Updated changelog

* Added option to start quiz

* resolved errors

* Added quiz option

* Updated gemfile

* 🤖 Automated Format and Fix

* Updated sdk versions (#1714)

* Updated sdk versions

* Fixed build errors

* 🤖 Automated Format and Fix

---------

Co-authored-by: Decoder07 <[email protected]>

* 🤖 Automated Format and Fix

* released sample app version 1.5.140 (440) 🍀

* updated packages

* 🤖 Automated Format and Fix

* Fixed bugs

* 🤖 Automated Format and Fix

* Added sorting for polls and quizzes

* 🤖 Automated Format and Fix

* release sample app version 1.5.141 (441) 🍀

* Added changelog

---------

Co-authored-by: Decoder07 <[email protected]>
Co-authored-by: Yogesh Singh <[email protected]>
Co-authored-by: ygit <[email protected]>
  • Loading branch information
4 people authored Feb 16, 2024
1 parent f0c9a2c commit 3f8e00a
Show file tree
Hide file tree
Showing 41 changed files with 1,126 additions and 367 deletions.
15 changes: 15 additions & 0 deletions packages/hms_room_kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.13 - 2024-02-16

| Package | Version |
| -------------- | ------------------------------------------------------------------------------------------------------ |
| hms_room_kit | 1.0.13 |
| hmssdk_flutter | 1.9.10 |

### 🚀 Added

- Introducing quizzes on prebuilt

Users can now create, manage, and stop quizzes directly from the prebuilt interface.

Updated `hmssdk_flutter` package version to 1.9.10

## 1.0.12 - 2024-02-12

| Package | Version |
Expand Down
39 changes: 19 additions & 20 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ packages:
dependency: transitive
description:
name: flutter_foreground_task
sha256: e48d2d810a2d643362e64de41146ed8e95d4dd282bae6abbb32309d9f0bf5d67
sha256: "9bcfcb43bba4a5446a056e723d21118ff6e184926b5557365c32c13caca157c2"
url: "https://pub.dev"
source: hosted
version: "6.1.2"
version: "6.1.3"
flutter_linkify:
dependency: transitive
description:
Expand Down Expand Up @@ -214,15 +214,14 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.12"
version: "1.0.13"
hmssdk_flutter:
dependency: transitive
description:
name: hmssdk_flutter
sha256: bad4ff87c677970f0c9acfcd4e84b60089461e1c1eef23e3a3ae6ab191484b95
url: "https://pub.dev"
source: hosted
version: "1.9.9"
path: "../../hmssdk_flutter"
relative: true
source: path
version: "1.9.10"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -467,10 +466,10 @@ packages:
dependency: transitive
description:
name: share_plus
sha256: f74fc3f1cbd99f39760182e176802f693fa0ec9625c045561cfad54681ea93dd
sha256: "3ef39599b00059db0990ca2e30fca0a29d8b37aae924d60063f8e0184cf20900"
url: "https://pub.dev"
source: hosted
version: "7.2.1"
version: "7.2.2"
share_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -624,10 +623,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f"
sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
url: "https://pub.dev"
source: hosted
version: "6.2.2"
version: "6.3.0"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -656,10 +655,10 @@ packages:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
Expand Down Expand Up @@ -688,26 +687,26 @@ packages:
dependency: transitive
description:
name: vector_graphics
sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172"
sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752"
url: "https://pub.dev"
source: hosted
version: "1.1.9+2"
version: "1.1.10+1"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d"
sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33
url: "https://pub.dev"
source: hosted
version: "1.1.9+2"
version: "1.1.10+1"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad"
sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a"
url: "https://pub.dev"
source: hosted
version: "1.1.9+2"
version: "1.1.10+1"
vector_math:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.12
version: 1.0.13

environment:
sdk: ">=2.19.6 <3.0.0"
Expand Down
10 changes: 10 additions & 0 deletions packages/hms_room_kit/lib/src/common/utility_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:shared_preferences/shared_preferences.dart';

///Project imports
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:tuple/tuple.dart';

///This class contains the utility functions used in the app
class Utilities {
Expand Down Expand Up @@ -121,6 +122,15 @@ class Utilities {
}
}

///This function returns the question type for poll/quiz
static List<Tuple2<String, HMSPollQuestionType>>
getQuestionTypeForPollQuiz() {
return const [
Tuple2("Single Choice", HMSPollQuestionType.singleChoice),
Tuple2("Multiple Choice", HMSPollQuestionType.multiChoice)
];
}

///This method returns the scale of the toast according to the index and the total number of toasts
static double getToastScale(int index, int toastsCount) {
if (toastsCount == 1) {
Expand Down
8 changes: 3 additions & 5 deletions packages/hms_room_kit/lib/src/hmssdk_interactor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,10 @@ class HMSSDKInteractor {
forPeer: forPeer, hmsActionResultListener: hmsActionResultListener);
}

void quickStartPoll(
{required HMSPollBuilder pollBuilder,
HMSActionResultListener? hmsActionResultListener}) {
void quickStartPoll({required HMSPollBuilder pollBuilder}) {
HMSPollInteractivityCenter.quickStartPoll(
pollBuilder: pollBuilder,
hmsActionResultListener: hmsActionResultListener);
pollBuilder: pollBuilder,
);
}

Future<dynamic> addSingleChoicePollResponse(
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import 'dart:math';
///Package imports
import 'package:flutter/material.dart';
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
import 'package:hms_room_kit/src/widgets/toasts/toast_widget.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';

///Project imports
import 'package:hms_room_kit/src/widgets/toasts/toast_widget.dart';
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/meeting/meeting_grid_component.dart';
import 'package:hms_room_kit/src/meeting/meeting_navigation_visibility_controller.dart';
Expand Down
33 changes: 27 additions & 6 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2236,10 +2236,9 @@ class MeetingStore extends ChangeNotifier

///Polls and Quiz
///Method to start poll
///Method to start poll and quiz
void quickStartPoll(HMSPollBuilder pollBuilder) {
_hmsSDKInteractor.quickStartPoll(
pollBuilder: pollBuilder, hmsActionResultListener: this);
_hmsSDKInteractor.quickStartPoll(pollBuilder: pollBuilder);
}

///Method to add Poll Response
Expand Down Expand Up @@ -2660,6 +2659,27 @@ class MeetingStore extends ChangeNotifier
notifyListeners();
}

///Insert poll question
void insertPollQuestion(HMSPollStore store) {
pollQuestions.add(store);
sortPollQuestions();
}

///Function to sort poll questions based on state and startedAt time
void sortPollQuestions() {
pollQuestions.sort((a, b) {
if (a.poll.state != b.poll.state) {
return a.poll.state == HMSPollState.started ? 1 : -1;
} else {
if (a.poll.startedAt != null && b.poll.startedAt != null) {
return a.poll.startedAt!.compareTo(b.poll.startedAt!);
}
}
return 1;
});
notifyListeners();
}

@override
void onPeerListUpdate(
{required List<HMSPeer> addedPeers,
Expand All @@ -2673,7 +2693,7 @@ class MeetingStore extends ChangeNotifier
@override
void onPollUpdate(
{required HMSPoll poll, required HMSPollUpdateType pollUpdateType}) {
log("onPollUpdate -> poll $poll updateType: $pollUpdateType startedAt: ${poll.startedAt}");
log("onPollUpdate -> poll $poll updateType: $pollUpdateType}");
switch (pollUpdateType) {
///If the poll is started we add the poll in questions list
case HMSPollUpdateType.started:
Expand All @@ -2691,7 +2711,7 @@ class MeetingStore extends ChangeNotifier
if (index == -1) {
HMSPollStore store = HMSPollStore(poll: poll);
if (HMSRoomLayout.peerType == PeerRoleType.conferencing) {
pollQuestions.add(store);
insertPollQuestion(store);
toasts.add(HMSToastModel(store,
hmsToastType: HMSToastsType.pollStartedToast));
notifyListeners();
Expand All @@ -2707,7 +2727,7 @@ class MeetingStore extends ChangeNotifier
if (poll.startedAt != null &&
(DateTime.now().difference(poll.startedAt!) >
const Duration(seconds: 20))) {
pollQuestions.add(store);
insertPollQuestion(store);
toasts.add(HMSToastModel(store,
hmsToastType: HMSToastsType.pollStartedToast));
} else {
Expand All @@ -2734,6 +2754,7 @@ class MeetingStore extends ChangeNotifier
.indexWhere((element) => element.poll.pollId == poll.pollId);
if (index != -1) {
pollQuestions[index].updateState(poll);
sortPollQuestions();
}
notifyListeners();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,30 @@ class _AppUtilitiesBottomSheetState extends State<AppUtilitiesBottomSheet> {
bottom: 24),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
///This renders the title and close button
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
HMSTitleText(
text: "Options",
textColor: HMSThemeColors.onSurfaceHighEmphasis,
letterSpacing: 0.15,
)
],
),
const Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
HMSCrossButton(),
],
)
],
),
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
HMSTitleText(
text: "Options",
textColor: HMSThemeColors.onSurfaceHighEmphasis,
letterSpacing: 0.15,
)
],
),
const Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
HMSCrossButton(),
],
)
],
),
]),
Padding(
padding: const EdgeInsets.only(top: 16, bottom: 16),
child: Divider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,28 @@ class _HLSMoreOptionsBottomSheetBottomSheetState
const EdgeInsets.only(top: 16.0, left: 20, right: 20, bottom: 24),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
HMSTitleText(
text: "Options",
textColor: HMSThemeColors.onSurfaceHighEmphasis,
letterSpacing: 0.15,
Row(
children: [
HMSTitleText(
text: "Options",
textColor: HMSThemeColors.onSurfaceHighEmphasis,
letterSpacing: 0.15,
)
],
),
const Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [HMSCrossButton()],
)
],
),
const Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [HMSCrossButton()],
)
],
),
Padding(
Expand Down
Loading

0 comments on commit 3f8e00a

Please sign in to comment.