diff --git a/packages/hms_room_kit/CHANGELOG.md b/packages/hms_room_kit/CHANGELOG.md index fcd681034..2d52a6805 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.16 - 2024-03-15 + +| Package | Version | +| -------------- | ------------------------------------------------------------------------------------------------------ | +| hms_room_kit | 1.0.16 | +| hmssdk_flutter | 1.9.13 | + +### 🚀 Added + +- Ability to join rooms directly without preview + + Prebuilt now allows direct room joining without preview, customizable via the dashboard's "customize prebuilt" section. + +Updated `hmssdk_flutter` package version to 1.9.13 + ## 1.0.15 - 2024-03-04 | Package | Version | diff --git a/packages/hms_room_kit/analysis_options.yaml b/packages/hms_room_kit/analysis_options.yaml index 5bcd91a2b..f49bd1b97 100644 --- a/packages/hms_room_kit/analysis_options.yaml +++ b/packages/hms_room_kit/analysis_options.yaml @@ -1,3 +1,3 @@ -include: package:flutter_lints/flutter.yaml +include: package:lints/core.yaml # Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +# https://dart.dev/guides/language/analysis-options \ No newline at end of file diff --git a/packages/hms_room_kit/example/pubspec.lock b/packages/hms_room_kit/example/pubspec.lock index 33a2b711e..3bdd17de3 100644 --- a/packages/hms_room_kit/example/pubspec.lock +++ b/packages/hms_room_kit/example/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -214,15 +214,15 @@ packages: path: ".." relative: true source: path - version: "1.0.15" + version: "1.0.16" hmssdk_flutter: dependency: transitive description: name: hmssdk_flutter - sha256: "2f689fad643f851447b2e95b55547cead6852fc6678c3c39fc62fb016754053e" + sha256: "3155ccd29881cd7ed36edf12db9f0355a586e78ae2c1249e6ca545ccdce73bc6" url: "https://pub.dev" source: hosted - version: "1.9.12" + version: "1.9.13" http: dependency: transitive description: @@ -255,6 +255,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" linkify: dependency: transitive description: @@ -283,26 +307,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -323,10 +347,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_parsing: dependency: transitive description: @@ -459,10 +483,10 @@ packages: dependency: transitive description: name: provider - sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.1.2" share_plus: dependency: transitive description: @@ -560,18 +584,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -592,10 +616,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: transitive description: @@ -724,14 +748,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.2" - web: + vm_service: dependency: transitive description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "13.0.0" win32: dependency: transitive description: @@ -757,5 +781,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/example/pubspec.yaml b/packages/hms_room_kit/example/pubspec.yaml index b0041f79a..a18071fd5 100644 --- a/packages/hms_room_kit/example/pubspec.yaml +++ b/packages/hms_room_kit/example/pubspec.yaml @@ -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.15 +version: 1.0.16 environment: sdk: ">=2.19.6 <3.0.0" diff --git a/packages/hms_room_kit/lib/src/common/utility_functions.dart b/packages/hms_room_kit/lib/src/common/utility_functions.dart index 687e0c8ed..7e1f436e9 100644 --- a/packages/hms_room_kit/lib/src/common/utility_functions.dart +++ b/packages/hms_room_kit/lib/src/common/utility_functions.dart @@ -1,3 +1,5 @@ +library; + ///Dart imports import 'dart:io'; import 'dart:math' as math; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart index 3354866d5..f9a90edfe 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart @@ -1,3 +1,5 @@ +library; + ///Package imports import 'package:flutter/material.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_bottom_navigation_bar.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_bottom_navigation_bar.dart index 364b42c10..4defbf420 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_bottom_navigation_bar.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_bottom_navigation_bar.dart @@ -1,3 +1,5 @@ +library; + ///Dart imports import 'dart:io'; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart index 1b2d934b8..b38c21f69 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart @@ -1,3 +1,5 @@ +library; + ///Dart imports import 'dart:developer'; import 'dart:io'; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart index 46c8ea8b2..75ad91091 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart @@ -1,3 +1,5 @@ +library; + ///Dart imports import 'dart:math'; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_waiting_ui.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_waiting_ui.dart index e0ccd9d8a..dd12f6881 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_waiting_ui.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_waiting_ui.dart @@ -1,3 +1,5 @@ +library; + ///Package imports import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/hls_viewer/overlay_chat_component.dart b/packages/hms_room_kit/lib/src/hls_viewer/overlay_chat_component.dart index 9eca6a19c..0c0b983c3 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/overlay_chat_component.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/overlay_chat_component.dart @@ -1,3 +1,5 @@ +library; + ///Package imports import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; diff --git a/packages/hms_room_kit/lib/src/hms_prebuilt.dart b/packages/hms_room_kit/lib/src/hms_prebuilt.dart index 0d44b79b1..7758c9486 100644 --- a/packages/hms_room_kit/lib/src/hms_prebuilt.dart +++ b/packages/hms_room_kit/lib/src/hms_prebuilt.dart @@ -1,3 +1,5 @@ +library; + ///Package imports import 'package:flutter/widgets.dart'; diff --git a/packages/hms_room_kit/lib/src/hms_prebuilt_options.dart b/packages/hms_room_kit/lib/src/hms_prebuilt_options.dart index 849410299..8d62d0749 100644 --- a/packages/hms_room_kit/lib/src/hms_prebuilt_options.dart +++ b/packages/hms_room_kit/lib/src/hms_prebuilt_options.dart @@ -1,3 +1,5 @@ +library; + ///Project imports import 'package:hms_room_kit/hms_room_kit.dart'; diff --git a/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart b/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart index 8265bd311..184d7e749 100644 --- a/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart +++ b/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:convert'; ///Package imports @@ -55,20 +57,19 @@ class ScreenElements { class Preview { final ScreenElements? previewHeader; final JoinForm? joinForm; + final bool? skipPreviewScreen; - Preview({ - this.previewHeader, - this.joinForm, - }); + Preview({this.previewHeader, this.joinForm, this.skipPreviewScreen = false}); factory Preview.fromJson(Map? json) { if (json == null) { return Preview(); } return Preview( - previewHeader: ScreenElements.fromJson(json['preview_header']), - joinForm: JoinForm.fromJson(json['join_form']), - ); + previewHeader: ScreenElements.fromJson( + json['default']?['elements']?['preview_header']), + joinForm: JoinForm.fromJson(json['default']?['elements']?['join_form']), + skipPreviewScreen: json["skip_preview_screen"]); } } @@ -124,7 +125,7 @@ class Screens { } return Screens( preview: json.containsKey('preview') == true - ? Preview.fromJson(json['preview']?['default']?['elements']) + ? Preview.fromJson(json['preview']) : null, conferencing: json.containsKey('conferencing') == true ? Conferencing.fromJson(json['conferencing']) @@ -218,6 +219,7 @@ class HMSRoomLayout { static bool isBRBEnabled = true; static List? offStageRoles = []; static bool skipPreviewForRole = false; + static bool skipPreview = false; static Future getRoomLayout( {required HMSSDKInteractor hmsSDKInteractor, @@ -253,6 +255,7 @@ class HMSRoomLayout { peerType = roleLayoutData?.screens?.conferencing?.hlsLiveStreaming != null ? PeerRoleType.hlsViewer : PeerRoleType.conferencing; + skipPreview = roleLayoutData?.screens?.preview?.skipPreviewScreen ?? false; if (peerType == PeerRoleType.conferencing) { chatData = roleLayoutData?.screens?.conferencing?.defaultConf?.elements?.chat; diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_bottom_navigation_bar.dart b/packages/hms_room_kit/lib/src/meeting/meeting_bottom_navigation_bar.dart index b86cb3a40..f291cf09c 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_bottom_navigation_bar.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_bottom_navigation_bar.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart b/packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart index 9829b788d..bc0e717c8 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:io'; ///Package imports @@ -26,9 +28,9 @@ class MeetingGridComponent extends StatelessWidget { Widget build(BuildContext context) { return Selector< MeetingStore, - Tuple6, bool, int, int, MeetingMode, - PeerTrackNode?>>( - selector: (_, meetingStore) => Tuple6( + Tuple7, bool, int, int, MeetingMode, + PeerTrackNode?, int>>( + selector: (_, meetingStore) => Tuple7( meetingStore.peerTracks, meetingStore.isHLSLink, meetingStore.peerTracks.length, @@ -36,9 +38,10 @@ class MeetingGridComponent extends StatelessWidget { meetingStore.meetingMode, meetingStore.peerTracks.isNotEmpty ? meetingStore.peerTracks[meetingStore.screenShareCount] - : null), + : null, + meetingStore.viewControllers.length), builder: (_, data, __) { - if (data.item3 == 0) { + if (data.item3 == 0 || data.item7 == 0) { return Center( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart index 66bc25957..f3eac453a 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:developer'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_navigation_visibility_controller.dart b/packages/hms_room_kit/lib/src/meeting/meeting_navigation_visibility_controller.dart index c0b5a1157..be23ca6ce 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_navigation_visibility_controller.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_navigation_visibility_controller.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:async'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_page.dart b/packages/hms_room_kit/lib/src/meeting/meeting_page.dart index 89b1f5cca..e46dac16d 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_page.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_page.dart @@ -10,6 +10,8 @@ import 'package:tuple/tuple.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; ///Project imports +import 'package:hms_room_kit/src/widgets/common_widgets/hms_hls_starting_overlay.dart'; +import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart' as HMSTheme; 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'; @@ -67,6 +69,14 @@ class _MeetingPageState extends State { context.read().initForegroundTask(); } + bool showError(int? errorCode) { + if (errorCode != null) { + List errorCodes = [1003, 2000, 4005, 424, 404]; + return errorCodes.contains(errorCode); + } + return false; + } + @override Widget build(BuildContext context) { return WillPopScope( @@ -382,24 +392,39 @@ class _MeetingPageState extends State { } return const SizedBox(); }), + if (HMSTheme + .HMSRoomLayout + .roleLayoutData + ?.screens + ?.preview + ?.joinForm + ?.joinBtnType == + HMSTheme.JoinButtonType + .JOIN_BTN_TYPE_JOIN_AND_GO_LIVE) + Selector>( + selector: (_, meetingStore) => + Tuple2( + meetingStore + .isHLSStarting, + meetingStore + .peerTracks.length), + builder: (_, hlsData, __) { + return (!hlsData.item1 || + hlsData.item2 == 0) + ? const SizedBox() + : HMSHLSStartingOverlay(); + }), if (failureErrors.item2 != null) - if (failureErrors.item2?.code?.errorCode == 1003 || - failureErrors.item2?.code - ?.errorCode == - 2000 || - failureErrors.item2?.code - ?.errorCode == - 4005 || - failureErrors.item2?.code - ?.errorCode == - 424) + if (showError(failureErrors + .item2?.code?.errorCode)) UtilityComponents .showFailureError( failureErrors.item2!, context, () => context .read() - .leave()) + .leave()), ], ), ), diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index cea378e7f..3b8bdd719 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:convert'; import 'dart:developer'; import 'dart:io'; @@ -50,7 +52,7 @@ class MeetingStore extends ChangeNotifier bool hasHlsStarted = false; - bool isHLSLoading = false; + bool isHLSStarting = false; String? streamUrl = ""; @@ -262,48 +264,31 @@ class MeetingStore extends ChangeNotifier ///List of bottom sheets currently open List bottomSheets = []; - Future join(String userName, {HMSConfig? roomConfig}) async { - //If roomConfig is null then only we call the methods to get the authToken - //If we are joining the room from preview we already have authToken so we don't - //need to call the getAuthTokenByRoomCode method - if (roomConfig == null) { - //We use this to get the auth token from room code - dynamic tokenData; - - if (Constant.roomCode != null) { - tokenData = await _hmsSDKInteractor.getAuthTokenByRoomCode( - userId: Constant.prebuiltOptions?.userId, - roomCode: Constant.roomCode!, - endPoint: Constant.tokenEndPoint); - } else { - tokenData = Constant.authToken; - } + Future join(String userName, String? tokenData) async { + late HMSConfig joinConfig; - ///If the tokenData is String then we set the authToken in the roomConfig - ///and then we join the room - /// - ///If the tokenData is HMSException then we return the HMSException i.e. tokenData - if ((tokenData is String?) && tokenData != null) { - ///Success Scenario - roomConfig = HMSConfig( - authToken: tokenData, - userName: userName, - captureNetworkQualityInPreview: true, - endPoint: Constant.initEndPoint); - } else { - ///Error Scenario - return tokenData; - } + ///Here we create the config using tokenData and userName + if (tokenData != null) { + joinConfig = HMSConfig( + authToken: tokenData, + userName: userName, + // endPoint is only required by 100ms Team. Client developers should not use `endPoint` + //This is only for 100ms internal testing, endPoint can be safely removed from + //the HMSConfig for external usage + endPoint: Constant.initEndPoint); } _hmsSDKInteractor.addUpdateListener(this); _hmsSDKInteractor.addLogsListener(this); HMSPollInteractivityCenter.addPollUpdateListener(listener: this); - HMSHLSPlayerController.addHMSHLSPlaybackEventsListener(this); + + if (HMSRoomLayout.peerType == PeerRoleType.hlsViewer) { + HMSHLSPlayerController.addHMSHLSPlaybackEventsListener(this); + } WidgetsBinding.instance.addObserver(this); setMeetingModeUsingLayoutApi(); - _hmsSDKInteractor.join(config: roomConfig); setRecipientSelectorValue(); + _hmsSDKInteractor.join(config: joinConfig); return null; } @@ -475,6 +460,9 @@ class MeetingStore extends ChangeNotifier toasts.removeWhere((toast) => (toast.hmsToastType == HMSToastsType.pollStartedToast) && (toast.toastData.poll.pollId == data)); + case HMSToastsType.streamingErrorToast: + toasts.removeWhere( + (toast) => toast.hmsToastType == HMSToastsType.streamingErrorToast); } notifyListeners(); } @@ -897,9 +885,17 @@ class MeetingStore extends ChangeNotifier } getCurrentAudioDevice(); getAudioDevicesList(); - notifyListeners(); setViewControllers(); + notifyListeners(); fetchPollList(HMSPollState.stopped); + + if (HMSRoomLayout.roleLayoutData?.screens?.preview?.joinForm?.joinBtnType == + JoinButtonType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && + !hasHlsStarted) { + isHLSStarting = true; + notifyListeners(); + startHLSStreaming(false, false); + } // if (Platform.isIOS && // HMSRoomLayout.roleLayoutData?.screens?.conferencing?.defaultConf != // null) { @@ -921,19 +917,27 @@ class MeetingStore extends ChangeNotifier void setParticipantsList(List roles) { String? onStageRoles = HMSRoomLayout.roleLayoutData?.screens?.conferencing ?.defaultConf?.elements?.onStageExp?.onStageRole; + + ///Here we initialise the map only if it doesn't contain the role if (onStageRoles != null) { - participantsInMeetingMap[onStageRoles] = []; + if (!participantsInMeetingMap.containsKey(onStageRoles)) { + participantsInMeetingMap[onStageRoles] = []; + } } roles .where((role) => role.publishSettings?.allowed.isNotEmpty ?? false) .forEach((element) { - participantsInMeetingMap[element.name] = []; + if (!participantsInMeetingMap.containsKey(element.name)) { + participantsInMeetingMap[element.name] = []; + } }); roles .where((role) => role.publishSettings?.allowed.isEmpty ?? false) .forEach((element) { - participantsInMeetingMap[element.name] = []; + if (!participantsInMeetingMap.containsKey(element.name)) { + participantsInMeetingMap[element.name] = []; + } }); } @@ -954,7 +958,7 @@ class MeetingStore extends ChangeNotifier @override void onRoomUpdate({required HMSRoom room, required HMSRoomUpdate update}) { - log("onRoomUpdate-> room: ${room.toString()} update: ${update.name}"); + log("meeting onRoomUpdate-> room: ${room.toString()} update: ${update.name}"); peersInRoom = room.peerCount; switch (update) { case HMSRoomUpdate.browserRecordingStateUpdated: @@ -974,7 +978,8 @@ class MeetingStore extends ChangeNotifier room.hmsRtmpStreamingState?.state ?? HMSStreamingState.none; break; case HMSRoomUpdate.hlsStreamingStateUpdated: - isHLSLoading = false; + isHLSStarting = + room.hmshlsStreamingState?.state == HMSStreamingState.starting; streamingType["hls"] = room.hmshlsStreamingState?.state ?? HMSStreamingState.none; hasHlsStarted = @@ -1429,6 +1434,14 @@ class MeetingStore extends ChangeNotifier void addPeer(HMSPeer peer) { if (!peers.contains(peer)) peers.add(peer); + + ///This check ensures that a key should be added to the map + ///if a peer is joined with a role which is not yet + ///in the map + if (!participantsInMeetingMap.containsKey(peer.role.name)) { + participantsInMeetingMap[peer.role.name] = []; + } + if (participantsInMeetingMap[peer.role.name] ?.indexWhere((element) => element.peer.peerId == peer.peerId) == -1) { @@ -1551,7 +1564,7 @@ class MeetingStore extends ChangeNotifier case HMSPeerUpdate.roleUpdated: if (peer.isLocal) { removeAllBottomSheets(); - getSpotlightPeer(); + // getSpotlightPeer(); setPreviousRole(localPeer?.role.name ?? ""); resetLayout(peer.role.name); localPeer = peer; @@ -1800,7 +1813,7 @@ class MeetingStore extends ChangeNotifier _hmsSessionStore?.addKeyChangeListener( keys: SessionStoreKeyValues.getSessionStoreKeys(), hmsKeyChangeListener: this); - getSpotlightPeer(); + // getSpotlightPeer(); } ///We get this call everytime metadata corresponding to a key is changed @@ -2439,7 +2452,6 @@ class MeetingStore extends ChangeNotifier } break; case HMSActionResultListenerMethod.hlsStreamingStarted: - isHLSLoading = true; hlsStreamingRetry = false; notifyListeners(); break; @@ -2542,6 +2554,10 @@ class MeetingStore extends ChangeNotifier case HMSActionResultListenerMethod.sendDirectMessage: break; case HMSActionResultListenerMethod.hlsStreamingStarted: + isHLSStarting = false; + toasts.add(HMSToastModel(hmsException, + hmsToastType: HMSToastsType.streamingErrorToast)); + notifyListeners(); break; case HMSActionResultListenerMethod.hlsStreamingStopped: break; diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_toasts.dart b/packages/hms_room_kit/lib/src/meeting/meeting_toasts.dart index 9873b83ba..f48e1c759 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_toasts.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_toasts.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/meeting_screen_controller.dart b/packages/hms_room_kit/lib/src/meeting_screen_controller.dart index 26a2ae744..4a0542854 100644 --- a/packages/hms_room_kit/lib/src/meeting_screen_controller.dart +++ b/packages/hms_room_kit/lib/src/meeting_screen_controller.dart @@ -1,11 +1,15 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:provider/provider.dart'; ///Project imports -import 'package:hms_room_kit/src/common/utility_functions.dart'; +import 'package:hms_room_kit/hms_room_kit.dart'; +import 'package:hms_room_kit/src/hmssdk_interactor.dart'; +import 'package:hms_room_kit/src/widgets/common_widgets/hms_loader.dart'; import 'package:hms_room_kit/src/hls_viewer/hls_player_store.dart'; import 'package:hms_room_kit/src/hls_viewer/hls_viewer_page.dart'; import 'package:hms_room_kit/src/meeting/meeting_page.dart'; @@ -40,9 +44,18 @@ class MeetingScreenController extends StatefulWidget { ///For more details checkout the [HMSConfig] class final HMSConfig? config; + ///[options] are the prebuilt options + final HMSPrebuiltOptions? options; + + ///[tokenData] is the auth token for the room + final String? tokenData; + ///[currentAudioDeviceMode] is the current audio device mode final HMSAudioDevice currentAudioDeviceMode; + ///[hmsSDKInteractor] is used to interact with the SDK + final HMSSDKInteractor hmsSDKInteractor; + const MeetingScreenController( {Key? key, required this.user, @@ -52,7 +65,10 @@ class MeetingScreenController extends StatefulWidget { this.mirrorCamera = true, this.role, this.config, - this.currentAudioDeviceMode = HMSAudioDevice.AUTOMATIC}) + this.currentAudioDeviceMode = HMSAudioDevice.AUTOMATIC, + this.options, + this.tokenData, + required this.hmsSDKInteractor}) : super(key: key); @override @@ -62,13 +78,42 @@ class MeetingScreenController extends StatefulWidget { class _MeetingScreenControllerState extends State { HLSPlayerStore? _hlsPlayerStore; + bool showLoader = false; + late MeetingStore _meetingStore; + @override void initState() { super.initState(); + + ///Here we create an instance of meeting store, set initial settings and join meeting. + _meetingStore = MeetingStore(hmsSDKInteractor: widget.hmsSDKInteractor); _setInitValues(); + _joinMeeting(); + + ///If the role is hlsStreaming we set the HLS Player store + if (HMSRoomLayout.roleLayoutData?.screens?.conferencing?.hlsLiveStreaming != + null) { + _setHLSPlayerStore(); + } Utilities.initForegroundTask(); } + ///This function joins the room only if the name is not empty + void _joinMeeting() async { + FocusManager.instance.primaryFocus?.unfocus(); + if (mounted) { + setState(() { + showLoader = true; + }); + } + + ///We join the room here + await _meetingStore.join(widget.user, widget.tokenData); + setState(() { + showLoader = false; + }); + } + ///This function sets the HLSPlayerStore if the role is hls-viewer void _setHLSPlayerStore() { _hlsPlayerStore ??= HLSPlayerStore(); @@ -76,27 +121,29 @@ class _MeetingScreenControllerState extends State { ///This function sets the initial values of the meeting void _setInitValues() async { - context.read().setSettings(); + _meetingStore.setSettings(); } @override Widget build(BuildContext context) { - return Selector( - builder: (_, data, __) { - ///If the role is hls-viewer then we show the HLSViewerPage - ///else we show the MeetingPage - if (HMSRoomLayout - .roleLayoutData?.screens?.conferencing?.hlsLiveStreaming != - null) { - _setHLSPlayerStore(); - return ListenableProvider.value( - value: _hlsPlayerStore, child: const HLSViewerPage()); - } - return MeetingPage( - isRoomMute: widget.isRoomMute, - currentAudioDeviceMode: widget.currentAudioDeviceMode, + return showLoader + ? const HMSLoader() + : ListenableProvider.value( + value: _meetingStore, + child: Selector( + selector: (_, meetingStore) => + meetingStore.localPeer?.role.name, + builder: (_, data, __) { + return (HMSRoomLayout.roleLayoutData?.screens?.conferencing + ?.hlsLiveStreaming != + null) + ? ListenableProvider.value( + value: _hlsPlayerStore, child: const HLSViewerPage()) + : MeetingPage( + isRoomMute: widget.isRoomMute, + currentAudioDeviceMode: widget.currentAudioDeviceMode, + ); + }), ); - }, - selector: (_, meetingStore) => meetingStore.localPeer?.role.name); } } diff --git a/packages/hms_room_kit/lib/src/model/participant_store.dart b/packages/hms_room_kit/lib/src/model/participant_store.dart index f4a089f8d..a7d908518 100644 --- a/packages/hms_room_kit/lib/src/model/participant_store.dart +++ b/packages/hms_room_kit/lib/src/model/participant_store.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/model/poll_store.dart b/packages/hms_room_kit/lib/src/model/poll_store.dart index be3968460..d5c4ead3f 100644 --- a/packages/hms_room_kit/lib/src/model/poll_store.dart +++ b/packages/hms_room_kit/lib/src/model/poll_store.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/preview/preview_bottom_button_section.dart b/packages/hms_room_kit/lib/src/preview/preview_bottom_button_section.dart index f5aacf97a..03536c290 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_bottom_button_section.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_bottom_button_section.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/preview/preview_device_settings.dart b/packages/hms_room_kit/lib/src/preview/preview_device_settings.dart index 3b0772308..ae89540fd 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_device_settings.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_device_settings.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:io'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/preview/preview_get_participants_text.dart b/packages/hms_room_kit/lib/src/preview/preview_get_participants_text.dart index ecd376822..b73cc1499 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_get_participants_text.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_get_participants_text.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/preview/preview_header.dart b/packages/hms_room_kit/lib/src/preview/preview_header.dart index c4b2650cb..cab8a0c3c 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_header.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_header.dart @@ -1,4 +1,6 @@ ///dart imports +library; + import 'dart:developer'; import 'dart:io'; @@ -20,13 +22,9 @@ import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart'; ///and the peer list is not empty and the peer role has the permission to receive room state class PreviewHeader extends StatelessWidget { final PreviewStore previewStore; - final bool isHidden; final double width; const PreviewHeader( - {super.key, - required this.previewStore, - required this.isHidden, - required this.width}); + {super.key, required this.previewStore, required this.width}); @override Widget build(BuildContext context) { @@ -54,61 +52,58 @@ class PreviewHeader extends StatelessWidget { ? 50 : 35), ), - child: isHidden - ? Container() - : Column( - children: [ - ///We render a generic logo which can be replaced - ///with the company logo from dashboard - HMSRoomLayout.roleLayoutData?.logo?.url == null - ? Container() - : HMSRoomLayout.roleLayoutData!.logo!.url!.contains("svg") - ? SvgPicture.network( - HMSRoomLayout.roleLayoutData!.logo!.url!, - height: 30, - width: 30, - ) - : Image.network( - HMSRoomLayout.roleLayoutData!.logo!.url!, - errorBuilder: (context, exception, _) { - log('Error is $exception'); - return const SizedBox( - width: 30, - height: 30, - ); - }, - height: 30, - width: 30, - ), - const SizedBox( - height: 16, - ), - HMSTitleText( - text: HMSRoomLayout.roleLayoutData?.screens?.preview - ?.previewHeader?.title ?? - "Get Started", - fontSize: 24, - lineHeight: 32, - textColor: HMSThemeColors.onSurfaceHighEmphasis), - const SizedBox( - height: 4, - ), - HMSSubheadingText( - text: HMSRoomLayout.roleLayoutData?.screens?.preview - ?.previewHeader?.subTitle ?? - "Setup your audio and video before joining", - textColor: HMSThemeColors.onSurfaceMediumEmphasis), + child: Column( + children: [ + ///We render a generic logo which can be replaced + ///with the company logo from dashboard + HMSRoomLayout.roleLayoutData?.logo?.url == null + ? Container() + : HMSRoomLayout.roleLayoutData!.logo!.url!.contains("svg") + ? SvgPicture.network( + HMSRoomLayout.roleLayoutData!.logo!.url!, + height: 30, + width: 30, + ) + : Image.network( + HMSRoomLayout.roleLayoutData!.logo!.url!, + errorBuilder: (context, exception, _) { + log('Error is $exception'); + return const SizedBox( + width: 30, + height: 30, + ); + }, + height: 30, + width: 30, + ), + const SizedBox( + height: 16, + ), + HMSTitleText( + text: HMSRoomLayout.roleLayoutData?.screens?.preview + ?.previewHeader?.title ?? + "Get Started", + fontSize: 24, + lineHeight: 32, + textColor: HMSThemeColors.onSurfaceHighEmphasis), + const SizedBox( + height: 4, + ), + HMSSubheadingText( + text: HMSRoomLayout.roleLayoutData?.screens?.preview + ?.previewHeader?.subTitle ?? + "Setup your audio and video before joining", + textColor: HMSThemeColors.onSurfaceMediumEmphasis), - ///Here we use SizedBox to keep the UI consistent - ///until we have received peer list or the room-state is - ///not enabled - const SizedBox( - height: 16, - ), - PreviewParticipantChip( - previewStore: previewStore, width: width) - ], - ), + ///Here we use SizedBox to keep the UI consistent + ///until we have received peer list or the room-state is + ///not enabled + const SizedBox( + height: 16, + ), + PreviewParticipantChip(previewStore: previewStore, width: width) + ], + ), ), ); } diff --git a/packages/hms_room_kit/lib/src/preview/preview_join_button.dart b/packages/hms_room_kit/lib/src/preview/preview_join_button.dart index 5a8f9b043..f90ca5c41 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_join_button.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_join_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -12,13 +14,9 @@ import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart'; class PreviewJoinButton extends StatelessWidget { final PreviewStore previewStore; final bool isEmpty; - final bool isJoining; const PreviewJoinButton( - {super.key, - required this.previewStore, - required this.isEmpty, - required this.isJoining}); + {super.key, required this.previewStore, required this.isEmpty}); @override Widget build(BuildContext context) { @@ -40,43 +38,32 @@ class PreviewJoinButton extends StatelessWidget { ///If the room join is in progress we show the loading indicator ///If the room join is not in progress we show the go live button - ? isJoining - ? const Center( - child: SizedBox( - height: 24, - width: 24, - child: CircularProgressIndicator( - strokeWidth: 3, - color: Colors.white, - ), - ), - ) - : Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/live.svg", - height: 24, - width: 24, - colorFilter: ColorFilter.mode( - isEmpty - ? HMSThemeColors.onPrimaryLowEmphasis - : HMSThemeColors.onPrimaryHighEmphasis, - BlendMode.srcIn), - ), - const SizedBox( - width: 8, - ), - HMSTitleText( - text: HMSRoomLayout.roleLayoutData?.screens?.preview - ?.joinForm?.goLiveBtnLabel ?? - 'Go Live', - textColor: isEmpty + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/live.svg", + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + isEmpty ? HMSThemeColors.onPrimaryLowEmphasis : HMSThemeColors.onPrimaryHighEmphasis, - ) - ], + BlendMode.srcIn), + ), + const SizedBox( + width: 8, + ), + HMSTitleText( + text: HMSRoomLayout.roleLayoutData?.screens?.preview?.joinForm + ?.goLiveBtnLabel ?? + 'Go Live', + textColor: isEmpty + ? HMSThemeColors.onPrimaryLowEmphasis + : HMSThemeColors.onPrimaryHighEmphasis, ) + ], + ) : Center( child: HMSTitleText( text: HMSRoomLayout diff --git a/packages/hms_room_kit/lib/src/preview/preview_network_indicator.dart b/packages/hms_room_kit/lib/src/preview/preview_network_indicator.dart index 3e4fc4fe1..494c9a35c 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_network_indicator.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_network_indicator.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -13,15 +15,12 @@ import 'package:hms_room_kit/src/preview/preview_store.dart'; ///The network quality is shown only if the [isHidden] is false class PreviewNetworkIndicator extends StatelessWidget { final PreviewStore previewStore; - final bool isHidden; - const PreviewNetworkIndicator( - {super.key, required this.previewStore, required this.isHidden}); + const PreviewNetworkIndicator({super.key, required this.previewStore}); @override Widget build(BuildContext context) { return ((previewStore.networkQuality != null && - previewStore.networkQuality != -1) && - !isHidden) + previewStore.networkQuality != -1)) ? Positioned( bottom: 168, left: 8, diff --git a/packages/hms_room_kit/lib/src/preview/preview_page.dart b/packages/hms_room_kit/lib/src/preview/preview_page.dart index b90fa3d47..14b33587a 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_page.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_page.dart @@ -1,49 +1,52 @@ ///Dart imports +library; + import 'dart:io'; ///Package imports -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; ///Project imports +import 'package:hms_room_kit/src/meeting_screen_controller.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hms_room_kit/src/common/utility_components.dart'; -import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart'; import 'package:hms_room_kit/src/preview/preview_bottom_button_section.dart'; import 'package:hms_room_kit/src/preview/preview_header.dart'; import 'package:hms_room_kit/src/preview/preview_join_button.dart'; import 'package:hms_room_kit/src/preview/preview_network_indicator.dart'; -import 'package:hms_room_kit/src/screen_controller.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_circular_avatar.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_loader.dart'; import 'package:hms_room_kit/src/widgets/hms_buttons/hms_back_button.dart'; -import 'package:hms_room_kit/src/meeting_screen_controller.dart'; import 'package:hms_room_kit/src/preview/preview_store.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_listenable_button.dart'; -import 'package:hms_room_kit/src/meeting/meeting_store.dart'; ///This renders the Preview Screen class PreviewPage extends StatefulWidget { final String name; final HMSPrebuiltOptions? options; + final String tokenData; - const PreviewPage({super.key, required this.name, required this.options}); + const PreviewPage( + {super.key, + required this.name, + required this.options, + required this.tokenData}); @override State createState() => _PreviewPageState(); } class _PreviewPageState extends State { - late MeetingStore _meetingStore; late TextEditingController nameController; - bool isJoiningRoom = false; - bool isHLSStarting = false; @override void initState() { super.initState(); nameController = TextEditingController(text: widget.name); + context + .read() + .startPreview(userName: widget.name, tokenData: widget.tokenData); } @override @@ -52,112 +55,25 @@ class _PreviewPageState extends State { super.dispose(); } - ///This function initializes the [MeetingStore] object - void _setMeetingStore(PreviewStore previewStore) { - _meetingStore = MeetingStore( - hmsSDKInteractor: previewStore.hmsSDKInteractor, - ); - _meetingStore.roles = previewStore.roles; - } - - ///This function joins the room only if the name is not empty - void _joinMeeting(PreviewStore previewStore) async { - if (nameController.text.trim().isNotEmpty) { - FocusManager.instance.primaryFocus?.unfocus(); - setState(() { - isJoiningRoom = true; - }); - - ///Here we set the [MeetingStore] object - _setMeetingStore(previewStore); - - /// We join the room here - HMSException? ans = await _meetingStore.join(nameController.text.trim(), - roomConfig: previewStore.roomConfig); - - ///If the room join fails we show the error dialog - if (ans != null && mounted) { - showGeneralDialog( - context: context, - pageBuilder: (_, data, __) { - return UtilityComponents.showFailureError( - ans, - context, - () => - Navigator.of(context).popUntil((route) => route.isFirst)); - }); - return; - } + ///[_navigateToMeeting] navigates to meeting from preview + void _navigateToMeeting(PreviewStore previewStore) { + HMSRole? role = previewStore.peer?.role; + int? localPeerNetworkQuality = previewStore.networkQuality; + bool isRoomMute = previewStore.isRoomMute; + HMSAudioDevice currentAudioDeviceMode = previewStore.currentAudioDeviceMode; - /// If the room join is successful - /// - If the join button type is `join only` or the HLS streaming is already started - /// - We navigate to the meeting screen - /// - /// - If the join button type is `join and go live` and the HLS streaming is not started - /// - We start the HLS streaming - previewStore.isRoomJoined = true; - previewStore.removePreviewListener(); - previewStore.hmsSDKInteractor.addUpdateListener(previewStore); + previewStore.removePreviewListener(); - ///When the user does not have permission to stream, or the stream is already started, or the flow is webRTC flow, then we directly navigate to the meeting screen. - ///Without starting the HLS stream. - if (HMSRoomLayout - .roleLayoutData?.screens?.preview?.joinForm?.joinBtnType == - JoinButtonType.JOIN_BTN_TYPE_JOIN_ONLY || - previewStore.isHLSStreamingStarted) { - previewStore.toggleIsRoomJoinedAndHLSStarted(); - previewStore.isMeetingJoined = true; - return; - } - - setState(() { - isJoiningRoom = false; - if (HMSRoomLayout - .roleLayoutData?.screens?.preview?.joinForm?.joinBtnType == - JoinButtonType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE) { - isHLSStarting = true; - } - }); - - _startStreaming(previewStore, _meetingStore); - } - } - - ///This function starts the HLS streaming - void _startStreaming( - PreviewStore previewStore, MeetingStore meetingStore) async { - HMSException? isStreamSuccessful; - Future.delayed(const Duration(milliseconds: 100)).then((value) async => { - isStreamSuccessful = - await _meetingStore.startHLSStreaming(false, false), - if (isStreamSuccessful != null) - { - previewStore.hmsSDKInteractor.toggleAlwaysScreenOn(), - setState(() { - isHLSStarting = false; - }), - previewStore.hmsSDKInteractor.removeUpdateListener(previewStore), - meetingStore.removeListeners(), - meetingStore.peerTracks.clear(), - meetingStore.resetForegroundTaskAndOrientation(), - // meetingStore.isRoomEnded = true, - previewStore.isMeetingJoined = false, - previewStore.hmsSDKInteractor.leave(), - HMSThemeColors.resetLayoutColors(), - navigateBack() - } - }); - } - - void navigateBack() { - Navigator.pushReplacement( - context, - CupertinoPageRoute( - builder: (_) => ScreenController( - roomCode: Constant.roomCode, - authToken: Constant.authToken, - options: widget.options, - ))); + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (context) => MeetingScreenController( + role: role, + localPeerNetworkQuality: localPeerNetworkQuality, + user: nameController.text.trim(), + isRoomMute: isRoomMute, + currentAudioDeviceMode: currentAudioDeviceMode, + tokenData: widget.tokenData, + hmsSDKInteractor: previewStore.hmsSDKInteractor, + ))); } @override @@ -169,308 +85,219 @@ class _PreviewPageState extends State { return WillPopScope( onWillPop: () async { - if (!previewStore.isRoomJoinedAndHLSStarted) { - previewStore.leave(); - } + previewStore.leave(); return true; }, child: Selector( selector: (_, previewStore) => previewStore.error, builder: (_, error, __) { - if (previewStore.isRoomJoinedAndHLSStarted) { - previewStore.hmsSDKInteractor.removeUpdateListener(previewStore); - } return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: HMSThemeColors.backgroundDim, - body: previewStore.isRoomJoinedAndHLSStarted - ? ListenableProvider.value( - value: _meetingStore, - child: MeetingScreenController( - role: previewStore.peer?.role, - localPeerNetworkQuality: null, - user: nameController.text, - isRoomMute: previewStore.isRoomMute, - currentAudioDeviceMode: - previewStore.currentAudioDeviceMode), - ) - : SingleChildScrollView( - ///We show circular progress indicator until the local peer is null - ///otherwise we render the preview - child: (previewStore.peer == null) - ? const HMSLoader() - /** + body: SingleChildScrollView( + ///We show circular progress indicator until the local peer is null + ///otherwise we render the preview + child: (previewStore.peer == null) + ? const HMSLoader() + /** * This component is used to render the video if the role has permission to publish video. * For hls-viewer role or role without video publishing permission we just render an empty container with screen height and width * The video is only rendered is camera is turned ON * Otherwise it will render the circular avatar */ - : Stack( - children: [ - ((!previewStore - .peer!.role.publishSettings!.allowed - .contains("video"))) - ? SizedBox( - height: height, - width: width, - ) - : Stack( - children: [ - Container( - height: height, - width: width, - color: HMSThemeColors.backgroundDim, + : Stack( + children: [ + ((!previewStore.peer!.role.publishSettings!.allowed + .contains("video"))) + ? SizedBox( + height: height, + width: width, + ) + : Stack( + children: [ + Container( + height: height, + width: width, + color: HMSThemeColors.backgroundDim, - ///This renders the video view - ///It will be shown only if the video is ON - ///and the role has permission to publish video - ///Otherwise it will render the circular avatar - child: (previewStore.isVideoOn) - ? Center( - child: HMSTextureView( - scaleType: ScaleType - .SCALE_ASPECT_FILL, - track: previewStore - .localTracks[0], - setMirror: true, - ), - ) - : isHLSStarting - ? Container() - : Center( - child: HMSCircularAvatar( - avatarTitleTextColor: - Colors.white, - name: nameController - .text), - ), - ), + ///This renders the video view + ///It will be shown only if the video is ON + ///and the role has permission to publish video + ///Otherwise it will render the circular avatar + child: (previewStore.isVideoOn) + ? Center( + child: HMSTextureView( + scaleType: + ScaleType.SCALE_ASPECT_FILL, + track: + previewStore.localTracks[0], + setMirror: true, + ), + ) + : Center( + child: HMSCircularAvatar( + avatarTitleTextColor: + Colors.white, + name: nameController.text), + ), + ), - ///This shows the network quality strength of the peer - ///It will be shown only if the network quality is not null - ///and not -1 and HLS is not starting - PreviewNetworkIndicator( - previewStore: previewStore, - isHidden: isHLSStarting) - ], - ), + ///This shows the network quality strength of the peer + ///It will be shown only if the network quality is not null + ///and not -1 and HLS is not starting + PreviewNetworkIndicator( + previewStore: previewStore, + ) + ], + ), - ///This renders the gradient background for the preview screen - ///It will be shown only if the peer role is not hls - ///and the video is ON - PreviewHeader( - previewStore: previewStore, - isHidden: isHLSStarting, - width: width), + PreviewHeader( + previewStore: previewStore, width: width), - ///This renders the back button at top left - if (!isHLSStarting) - Positioned( - top: Platform.isIOS ? 50 : 35, - left: 10, - child: HMSBackButton( - onPressed: () => { - previewStore.leave(), - Navigator.pop(context) - })), + ///This renders the back button at top left + Positioned( + top: Platform.isIOS ? 50 : 35, + left: 10, + child: HMSBackButton( + onPressed: () => { + previewStore.leave(), + Navigator.pop(context) + })), - ///This renders the bottom sheet with microphone, camera and audio device settings - ///This also contains text field for entering the name - /// - ///This is only rendered when the peer is not null - ///and the HLS is not starting - Positioned( - bottom: 0, - child: (previewStore.peer != null && - !isHLSStarting) - ? Container( - decoration: BoxDecoration( - borderRadius: - const BorderRadius.only( - topLeft: - Radius.circular(16), - topRight: - Radius.circular(16)), - color: HMSThemeColors - .backgroundDefault, + ///This renders the bottom sheet with microphone, camera and audio device settings + ///This also contains text field for entering the name + /// + ///This is only rendered when the peer is not null + ///and the HLS is not starting + Positioned( + bottom: 0, + child: (previewStore.peer != null) + ? Container( + decoration: BoxDecoration( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(16), + topRight: Radius.circular(16)), + color: HMSThemeColors.backgroundDefault, + ), + width: width, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0, vertical: 16), + child: Column( + children: [ + ///This renders the preview page bottom buttons + PreviewBottomButtonSection( + previewStore: previewStore), + const SizedBox( + height: 16, ), - width: width, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0, vertical: 16), - child: Column( - children: [ - ///This renders the preview page bottom buttons - PreviewBottomButtonSection( - previewStore: previewStore), - const SizedBox( - height: 16, - ), - ///This renders the name text field and join button - Padding( - padding: - const EdgeInsets.only( - bottom: 24.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - SizedBox( - height: 48, - width: width * 0.50, - child: TextField( - enabled: widget.name - .trim() - .isEmpty, - cursorColor: - HMSThemeColors - .onSurfaceHighEmphasis, - onTapOutside: (event) => - FocusManager - .instance - .primaryFocus - ?.unfocus(), - textInputAction: - TextInputAction - .done, - textCapitalization: - TextCapitalization - .words, - style: HMSTextStyle - .setTextStyle( - color: HMSThemeColors - .onSurfaceHighEmphasis), - controller: - nameController, - keyboardType: - TextInputType - .text, - onChanged: (value) { - setState(() {}); - }, - decoration: - InputDecoration( - contentPadding: - const EdgeInsets.symmetric( - vertical: - 12, - horizontal: - 16), - fillColor: HMSThemeColors - .surfaceDefault, - filled: true, + ///This renders the name text field and join button + Padding( + padding: const EdgeInsets.only( + bottom: 24.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + SizedBox( + height: 48, + width: width * 0.50, + child: TextField( + enabled: widget.name + .trim() + .isEmpty, + cursorColor: HMSThemeColors + .onSurfaceHighEmphasis, + onTapOutside: (event) => + FocusManager.instance + .primaryFocus + ?.unfocus(), + textInputAction: + TextInputAction.done, + textCapitalization: + TextCapitalization + .words, + style: HMSTextStyle.setTextStyle( + color: HMSThemeColors + .onSurfaceHighEmphasis), + controller: nameController, + keyboardType: + TextInputType.text, + onChanged: (value) { + setState(() {}); + }, + decoration: InputDecoration( + contentPadding: + const EdgeInsets.symmetric( + vertical: 12, + horizontal: 16), + fillColor: HMSThemeColors + .surfaceDefault, + filled: true, - ///This renders the hint text - hintText: - 'Enter Name...', - hintStyle: HMSTextStyle.setTextStyle( - color: HMSThemeColors - .onSurfaceLowEmphasis, - height: - 1.5, - fontSize: - 16, - letterSpacing: - 0.5, - fontWeight: FontWeight - .w400), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - width: - 2, - color: HMSThemeColors - .primaryDefault), - borderRadius: - const BorderRadius.all(Radius.circular( - 8))), - enabledBorder: const OutlineInputBorder( - borderSide: - BorderSide - .none, - borderRadius: - BorderRadius.all(Radius.circular(8))), - border: const OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(8)))), - ), - ), - HMSListenableButton( - isDisabled: - isHLSStarting, - textController: - nameController, - width: width * 0.38, - onPressed: () => - _joinMeeting( - previewStore), - childWidget: - PreviewJoinButton( - isEmpty: - nameController - .text - .trim() - .isEmpty, - previewStore: - previewStore, - isJoining: - isJoiningRoom, - ), - ), - ], + ///This renders the hint text + hintText: + 'Enter Name...', + hintStyle: HMSTextStyle.setTextStyle( + color: HMSThemeColors + .onSurfaceLowEmphasis, + height: 1.5, + fontSize: 16, + letterSpacing: 0.5, + fontWeight: FontWeight + .w400), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 2, + color: HMSThemeColors + .primaryDefault), + borderRadius: + const BorderRadius.all( + Radius.circular( + 8))), + enabledBorder: const OutlineInputBorder( + borderSide: + BorderSide.none, + borderRadius: + BorderRadius.all(Radius.circular(8))), + border: const OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(8)))), + ), + ), + HMSListenableButton( + textController: + nameController, + width: width * 0.38, + onPressed: () => + _navigateToMeeting( + previewStore), + childWidget: + PreviewJoinButton( + isEmpty: nameController.text + .trim() + .isEmpty, + previewStore: previewStore, ), ), ], ), ), - ) - : const SizedBox(), - ), - if (isHLSStarting) - Container( - height: height, - width: width, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - HMSThemeColors.backgroundDim - .withOpacity(1), - HMSThemeColors.backgroundDim - .withOpacity(0) - ], - )), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - CircularProgressIndicator( - strokeWidth: 2, - color: HMSThemeColors.primaryDefault, - ), - const SizedBox( - height: 29, - ), - HMSSubtitleText( - text: "Starting live stream...", - textColor: HMSThemeColors - .onSurfaceHighEmphasis, - fontSize: 16, - lineHeight: 24, - letterSpacing: 0.50, - ) - ], + ], + ), ), - ), - if (error != null) - UtilityComponents.showFailureError( - error, - context, - () => Navigator.of(context) - .popUntil((route) => route.isFirst)), - ], - ), - ), + ) + : const SizedBox(), + ), + if (error != null) + UtilityComponents.showFailureError( + error, + context, + () => Navigator.of(context) + .popUntil((route) => route.isFirst)), + ], + ), + ), ); }), ); diff --git a/packages/hms_room_kit/lib/src/preview/preview_participant_chip.dart b/packages/hms_room_kit/lib/src/preview/preview_participant_chip.dart index 9715fb9ce..9aa0b51b1 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_participant_chip.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_participant_chip.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/widgets.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/preview/preview_permissions.dart b/packages/hms_room_kit/lib/src/preview/preview_permissions.dart index 2c1b25221..f9d5608fe 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_permissions.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_permissions.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:io'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/preview/preview_store.dart b/packages/hms_room_kit/lib/src/preview/preview_store.dart index a839e690b..09dbf06f1 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_store.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_store.dart @@ -11,7 +11,7 @@ import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart'; import 'package:hms_room_kit/src/hmssdk_interactor.dart'; class PreviewStore extends ChangeNotifier - implements HMSPreviewListener, HMSLogListener, HMSUpdateListener { + implements HMSPreviewListener, HMSLogListener { late HMSSDKInteractor hmsSDKInteractor; PreviewStore({required this.hmsSDKInteractor}); @@ -33,12 +33,6 @@ class PreviewStore extends ChangeNotifier bool isHLSStreamingStarted = false; - bool isRoomJoinedAndHLSStarted = false; - - bool isRoomJoined = false; - - bool isMeetingJoined = false; - bool isRTMPStreamingStarted = false; List? peers; @@ -57,8 +51,6 @@ class PreviewStore extends ChangeNotifier int peerCount = 0; - HMSConfig? roomConfig; - @override void onHMSError({required HMSException error}) { this.error = error; @@ -106,39 +98,20 @@ class PreviewStore extends ChangeNotifier notifyListeners(); } - Future startPreview({required String userName}) async { - //We use this to get the auth token from room code - - dynamic tokenData; - if (Constant.roomCode != null) { - tokenData = await hmsSDKInteractor.getAuthTokenByRoomCode( - userId: Constant.prebuiltOptions?.userId, - roomCode: Constant.roomCode!, - endPoint: Constant.tokenEndPoint); - } else { - tokenData = Constant.authToken; - } - - if ((tokenData is String?) && tokenData != null) { - roomConfig = HMSConfig( - authToken: tokenData, - userName: userName, - captureNetworkQualityInPreview: true, - // endPoint is only required by 100ms Team. Client developers should not use `endPoint` - //This is only for 100ms internal testing, endPoint can be safely removed from - //the HMSConfig for external usage - endPoint: Constant.initEndPoint); - await HMSRoomLayout.getRoomLayout( - hmsSDKInteractor: hmsSDKInteractor, - authToken: tokenData, - endPoint: Constant.layoutAPIEndPoint); - hmsSDKInteractor.startHMSLogger( - Constant.webRTCLogLevel, Constant.sdkLogLevel); - hmsSDKInteractor.addPreviewListener(this); - hmsSDKInteractor.preview(config: roomConfig!); - return null; - } - return tokenData; + void startPreview( + {required String userName, required String tokenData}) async { + HMSConfig joinRoomConfig = HMSConfig( + authToken: tokenData, + userName: userName, + captureNetworkQualityInPreview: true, + // endPoint is only required by 100ms Team. Client developers should not use `endPoint` + //This is only for 100ms internal testing, endPoint can be safely removed from + //the HMSConfig for external usage + endPoint: Constant.initEndPoint); + hmsSDKInteractor.startHMSLogger( + Constant.webRTCLogLevel, Constant.sdkLogLevel); + hmsSDKInteractor.addPreviewListener(this); + hmsSDKInteractor.preview(config: joinRoomConfig); } @override @@ -175,7 +148,7 @@ class PreviewStore extends ChangeNotifier @override void onRoomUpdate({required HMSRoom room, required HMSRoomUpdate update}) { this.room = room; - log("onRoomUpdate-> room: ${room.toString()} update: ${update.name} streamingState: ${room.hmshlsStreamingState?.state.name}"); + log("preview onRoomUpdate-> room: ${room.toString()} update: ${update.name} streamingState: ${room.hmshlsStreamingState?.state.name}"); switch (update) { case HMSRoomUpdate.browserRecordingStateUpdated: isRecordingStarted = @@ -198,10 +171,6 @@ class PreviewStore extends ChangeNotifier case HMSRoomUpdate.hlsStreamingStateUpdated: isHLSStreamingStarted = room.hmshlsStreamingState?.state == HMSStreamingState.started; - if (!isMeetingJoined && isRoomJoined && isHLSStreamingStarted) { - isRoomJoinedAndHLSStarted = true; - isMeetingJoined = true; - } break; case HMSRoomUpdate.roomPeerCountUpdated: peerCount = room.peerCount; @@ -323,49 +292,4 @@ class PreviewStore extends ChangeNotifier } notifyListeners(); } - - void toggleIsRoomJoinedAndHLSStarted() { - isRoomJoinedAndHLSStarted = (!isRoomJoinedAndHLSStarted && isRoomJoined); - notifyListeners(); - } - - @override - void onChangeTrackStateRequest( - {required HMSTrackChangeRequest hmsTrackChangeRequest}) {} - - @override - void onJoin({required HMSRoom room}) {} - - @override - void onMessage({required HMSMessage message}) {} - - @override - void onReconnected() {} - - @override - void onReconnecting() {} - - @override - void onRemovedFromRoom( - {required HMSPeerRemovedFromPeer hmsPeerRemovedFromPeer}) {} - - @override - void onRoleChangeRequest({required HMSRoleChangeRequest roleChangeRequest}) {} - - @override - void onSessionStoreAvailable({HMSSessionStore? hmsSessionStore}) {} - - @override - void onTrackUpdate( - {required HMSTrack track, - required HMSTrackUpdate trackUpdate, - required HMSPeer peer}) {} - - @override - void onUpdateSpeakers({required List updateSpeakers}) {} - - @override - void onPeerListUpdate( - {required List addedPeers, - required List removedPeers}) {} } diff --git a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_bottom_sheet.dart b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_bottom_sheet.dart index 3062c2b82..3fae2dfbc 100644 --- a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart index 82c65b90c..09413c163 100644 --- a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart +++ b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:developer'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/preview_meeting_flow.dart b/packages/hms_room_kit/lib/src/preview_meeting_flow.dart new file mode 100644 index 000000000..9391cc15e --- /dev/null +++ b/packages/hms_room_kit/lib/src/preview_meeting_flow.dart @@ -0,0 +1,59 @@ +///Package imports +library; + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +///Project imports +import 'package:hms_room_kit/hms_room_kit.dart'; +import 'package:hms_room_kit/src/hmssdk_interactor.dart'; +import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart'; +import 'package:hms_room_kit/src/meeting_screen_controller.dart'; +import 'package:hms_room_kit/src/preview/preview_page.dart'; +import 'package:hms_room_kit/src/preview/preview_store.dart'; + +///[PreviewMeetingFlow] decides whether to render preview or meeting +class PreviewMeetingFlow extends StatefulWidget { + final HMSPrebuiltOptions? prebuiltOptions; + final HMSSDKInteractor hmsSDKInteractor; + final String tokenData; + const PreviewMeetingFlow( + {super.key, + required this.prebuiltOptions, + required this.hmsSDKInteractor, + required this.tokenData}); + + @override + State createState() => _PreviewMeetingFlowState(); +} + +class _PreviewMeetingFlowState extends State { + late PreviewStore store; + + @override + void initState() { + super.initState(); + if (!HMSRoomLayout.skipPreview) { + store = PreviewStore(hmsSDKInteractor: widget.hmsSDKInteractor); + } + } + + @override + Widget build(BuildContext context) { + return HMSRoomLayout.skipPreview + ? MeetingScreenController( + user: widget.prebuiltOptions?.userId ?? "", + localPeerNetworkQuality: null, + options: widget.prebuiltOptions, + tokenData: widget.tokenData, + hmsSDKInteractor: widget.hmsSDKInteractor, + ) + : ListenableProvider.value( + value: store, + child: PreviewPage( + name: widget.prebuiltOptions?.userName ?? "", + options: widget.prebuiltOptions, + tokenData: widget.tokenData, + )); + } +} diff --git a/packages/hms_room_kit/lib/src/screen_controller.dart b/packages/hms_room_kit/lib/src/screen_controller.dart index 0b4b10886..753daee92 100644 --- a/packages/hms_room_kit/lib/src/screen_controller.dart +++ b/packages/hms_room_kit/lib/src/screen_controller.dart @@ -1,15 +1,16 @@ ///Package imports +library; + import 'package:flutter/material.dart'; +import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart'; +import 'package:hms_room_kit/src/preview_meeting_flow.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/common/utility_components.dart'; import 'package:hms_room_kit/src/hmssdk_interactor.dart'; -import 'package:hms_room_kit/src/preview/preview_page.dart'; import 'package:hms_room_kit/src/preview/preview_permissions.dart'; -import 'package:hms_room_kit/src/preview/preview_store.dart'; ///[ScreenController] is the controller for the preview screen ///It takes following parameters: @@ -45,8 +46,9 @@ class ScreenController extends StatefulWidget { class _ScreenControllerState extends State { bool isPermissionGranted = false; late HMSSDKInteractor _hmsSDKInteractor; - late PreviewStore _previewStore; bool isLoading = true; + HMSConfig? roomConfig; + dynamic tokenData; @override void initState() { @@ -96,6 +98,32 @@ class _ScreenControllerState extends State { } } + ///[_getAuthTokenAndSetLayout] gets the auth token and set the room layout + ///using the auth token + ///If [getAuthTokenByRoomCode] fails it returns HMSException object + ///else null + Future _getAuthTokenAndSetLayout( + HMSSDKInteractor hmssdkInteractor, String userName) async { + if (Constant.roomCode != null) { + tokenData = await hmssdkInteractor.getAuthTokenByRoomCode( + userId: Constant.prebuiltOptions?.userId, + roomCode: Constant.roomCode!, + endPoint: Constant.tokenEndPoint); + } else { + tokenData = Constant.authToken; + } + + if ((tokenData is String?) && tokenData != null) { + await HMSRoomLayout.getRoomLayout( + hmsSDKInteractor: hmssdkInteractor, + authToken: tokenData, + endPoint: Constant.layoutAPIEndPoint); + return null; + } else { + return tokenData; + } + } + ///This function initializes the preview ///- Assign the _hmssdkInteractor an instance of HMSSDKInteractor ///- Build the HMSSDK @@ -110,6 +138,7 @@ class _ScreenControllerState extends State { isLoading = true; }); } + _hmsSDKInteractor = HMSSDKInteractor( iOSScreenshareConfig: widget.options?.iOSScreenshareConfig, joinWithMutedAudio: true, @@ -118,11 +147,11 @@ class _ScreenControllerState extends State { isAudioMixerDisabled: AppDebugConfig.isAudioMixerDisabled, isPrebuilt: true); await _hmsSDKInteractor.build(); - _previewStore = PreviewStore(hmsSDKInteractor: _hmsSDKInteractor); - HMSException? ans = await _previewStore.startPreview( - userName: widget.options?.userName ?? ""); - ///If preview fails then we show the error dialog + var ans = await _getAuthTokenAndSetLayout( + _hmsSDKInteractor, widget.options?.userName ?? ""); + + ///If fetching auth token fails then we show the error dialog ///with the error message and description if (ans != null && mounted) { showGeneralDialog( @@ -132,13 +161,12 @@ class _ScreenControllerState extends State { () => Navigator.of(context).popUntil((route) => route.isFirst)); }); } else { - _hmsSDKInteractor.toggleAlwaysScreenOn(); + Constant.debugMode = AppDebugConfig.isDebugMode; if (mounted) { setState(() { isLoading = false; }); } - Constant.debugMode = AppDebugConfig.isDebugMode; } } @@ -156,7 +184,7 @@ class _ScreenControllerState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: isLoading + body: (isLoading) ? Center( child: CircularProgressIndicator( strokeWidth: 2, @@ -164,12 +192,11 @@ class _ScreenControllerState extends State { ), ) : isPermissionGranted - ? ListenableProvider.value( - value: _previewStore, - child: PreviewPage( - name: widget.options?.userName?.trim() ?? "", - options: widget.options, - )) + ? PreviewMeetingFlow( + prebuiltOptions: widget.options, + hmsSDKInteractor: _hmsSDKInteractor, + tokenData: tokenData, + ) : PreviewPermissions( options: widget.options, callback: _isPermissionGrantedCallback), diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/app_utilities_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/app_utilities_bottom_sheet.dart index 645ccd78b..471c6ad37 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/app_utilities_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/app_utilities_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:badges/badges.dart' as badge; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/audio_settings_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/audio_settings_bottom_sheet.dart index 8a38ddb4e..c8d65efb4 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/audio_settings_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/audio_settings_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/change_name_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/change_name_bottom_sheet.dart index 7ba5b474e..e21527663 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/change_name_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/change_name_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_only_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_only_bottom_sheet.dart index 7c5ff0568..fecab62e6 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_only_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_only_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart index 4d24872fd..2cec15a3e 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/end_service_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/end_service_bottom_sheet.dart index 9eec948b2..54e89f46a 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/end_service_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/end_service_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/hls_app_utilities_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/hls_app_utilities_bottom_sheet.dart index b1fa98ce5..8d8c42d20 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/hls_app_utilities_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/hls_app_utilities_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hms_room_kit/src/widgets/bottom_sheets/poll_and_quiz_bottom_sheet.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/local_peer_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/local_peer_bottom_sheet.dart index 6659c1dc7..3095335f3 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/local_peer_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/local_peer_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart index 90c7753bd..7ff427234 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:async'; import 'dart:convert'; import 'dart:developer'; diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart index 9f48c5d4a..76a136981 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:convert'; import 'dart:developer'; 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 fca01a832..d89f5b24d 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 @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_creation_widgets/poll_quiz_form.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_quiz_selection_widget.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 61d1b5af3..27d2cbf92 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,4 +1,6 @@ ///Dart imports +library; + import 'dart:io'; import 'dart:math' as math; @@ -105,6 +107,18 @@ class _PollVoteBottomSheetState extends State { } } + String _getUserName(HMSPollStore hmsPollStore) { + String? userName = hmsPollStore.poll.createdBy?.name; + if (userName != null) { + if (userName.length > 15) { + return userName.substring(0, math.min(15, userName.length)) + "..."; + } + return userName; + } else { + return "Participant"; + } + } + @override Widget build(BuildContext context) { var hmsPollStore = context.watch(); @@ -174,9 +188,8 @@ class _PollVoteBottomSheetState extends State { ), ), HMSTitleText( - text: hmsPollStore.poll.createdBy == null - ? "Participant started a new ${hmsPollStore.poll.category == HMSPollCategory.poll ? "poll" : "quiz"}" - : "${hmsPollStore.poll.createdBy?.name.substring(0, math.min(15, hmsPollStore.poll.createdBy?.name.length ?? 0)) ?? ""} started a ${widget.isPoll ? "poll" : "quiz"}", + text: + "${_getUserName(hmsPollStore)} started a ${widget.isPoll ? "poll" : "quiz"}", textColor: HMSThemeColors.onSurfaceHighEmphasis, letterSpacing: 0.15, ), diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/remote_peer_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/remote_peer_bottom_sheet.dart index be92c7d03..8e6288fbc 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/remote_peer_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/remote_peer_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/chat_widgets/chat_text_field.dart b/packages/hms_room_kit/lib/src/widgets/chat_widgets/chat_text_field.dart index 133b4d363..cf25706c5 100644 --- a/packages/hms_room_kit/lib/src/widgets/chat_widgets/chat_text_field.dart +++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/chat_text_field.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:math' as math; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/chat_widgets/hms_empty_chat_widget.dart b/packages/hms_room_kit/lib/src/widgets/chat_widgets/hms_empty_chat_widget.dart index 1f190b52e..a5436a2d5 100644 --- a/packages/hms_room_kit/lib/src/widgets/chat_widgets/hms_empty_chat_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/hms_empty_chat_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/chat_widgets/pin_chat_widget.dart b/packages/hms_room_kit/lib/src/widgets/chat_widgets/pin_chat_widget.dart index d51ff8f25..efff9f9a1 100644 --- a/packages/hms_room_kit/lib/src/widgets/chat_widgets/pin_chat_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/pin_chat_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_chip.dart b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_chip.dart index c39a78cb1..7920e612e 100644 --- a/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_chip.dart +++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_chip.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_widget.dart b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_widget.dart index 4446844da..e6adc83f6 100644 --- a/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + 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/common_widgets/degrade_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart index 750f726f3..3458eebcb 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_button.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_button.dart index d60388e2b..14ca1dc45 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_circular_avatar.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_circular_avatar.dart index fd2a488d7..91a25fbaf 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_circular_avatar.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_circular_avatar.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_cross_button.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_cross_button.dart index 065f99743..a5545f62b 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_cross_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_cross_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_embedded_button.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_embedded_button.dart index 89803ee88..83c8ec2b7 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_embedded_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_embedded_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/layout_api/hms_theme_colors.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_hls_starting_overlay.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_hls_starting_overlay.dart new file mode 100644 index 000000000..62e81494f --- /dev/null +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_hls_starting_overlay.dart @@ -0,0 +1,45 @@ +///Package imports +library; + +import 'package:flutter/material.dart'; + +///Project imports +import 'package:hms_room_kit/src/layout_api/hms_theme_colors.dart'; +import 'package:hms_room_kit/src/widgets/common_widgets/hms_subtitle_text.dart'; + +///[HMSHLSStartingOverlay] renders the overlay UI while HLS is starting +class HMSHLSStartingOverlay extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + HMSThemeColors.backgroundDim.withOpacity(1), + HMSThemeColors.backgroundDim.withOpacity(0) + ])), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator( + strokeWidth: 2, + color: HMSThemeColors.primaryDefault, + ), + const SizedBox( + height: 29, + ), + HMSSubtitleText( + text: "Starting live stream...", + textColor: HMSThemeColors.onSurfaceHighEmphasis, + fontSize: 16, + lineHeight: 24, + letterSpacing: 0.50, + ) + ], + ), + ); + } +} diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_left_room_screen.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_left_room_screen.dart index d63a42ec0..9b10f211a 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_left_room_screen.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_left_room_screen.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_listenable_button.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_listenable_button.dart index 6a1686b32..dc16e7936 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_listenable_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_listenable_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_loader.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_loader.dart index 292a64367..7a9be7b56 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_loader.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_loader.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subheading_text.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subheading_text.dart index 4cc373df6..8f511bb9c 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subheading_text.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subheading_text.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subtitle_text.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subtitle_text.dart index 2f3e306a7..6cd6e9bda 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subtitle_text.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_subtitle_text.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_text_style.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_text_style.dart index 2400ed69c..34d97a2d2 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_text_style.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_text_style.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_title_text.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_title_text.dart index bba895b99..945a21979 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_title_text.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/hms_title_text.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/inset_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/inset_tile.dart index 53685bd57..9351a688e 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/inset_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/inset_tile.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:async'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/live_badge.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/live_badge.dart index 478f42118..c547559ec 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/live_badge.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/live_badge.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/message_container.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/message_container.dart index bdd456ea9..5b042ac56 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/message_container.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/message_container.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/more_option_item.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/more_option_item.dart index 389615e09..22ee43ff0 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/more_option_item.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/more_option_item.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/name_and_network.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/name_and_network.dart index cc0f5cbe1..6f322d296 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/name_and_network.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/name_and_network.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/five_tile_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/five_tile_layout.dart index acd1d9a9f..3b2c7ff7b 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/five_tile_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/five_tile_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/four_tile_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/four_tile_layout.dart index 345dbc3c0..c71b821b6 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/four_tile_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/four_tile_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/grid_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/grid_layout.dart index 5d28da444..af9bbde0a 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/grid_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/grid_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart index 47c29fc16..ec4962a4b 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart index 92b4430f9..a1029606e 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/side_by_side_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/side_by_side_layout.dart index 7b2c05709..3d6f88433 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/side_by_side_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/side_by_side_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/six_tile_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/six_tile_layout.dart index 9f49ca271..e0677db85 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/six_tile_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/six_tile_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/three_tile_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/three_tile_layout.dart index da90efba9..7a5414c68 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/three_tile_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/three_tile_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/two_tile_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/two_tile_layout.dart index 6c8de446e..1e887aab0 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/two_tile_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/two_tile_layout.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/hms_buttons/hms_back_button.dart b/packages/hms_room_kit/lib/src/widgets/hms_buttons/hms_back_button.dart index 517ab196b..b347554fd 100644 --- a/packages/hms_room_kit/lib/src/widgets/hms_buttons/hms_back_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/hms_buttons/hms_back_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index 99dac3e54..8aa633dc0 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart index 451a892f0..c5ad88889 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:io'; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/audio_level_avatar.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/audio_level_avatar.dart index 8ce9bef95..b1cc11ff0 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/audio_level_avatar.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/audio_level_avatar.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/inset_collapsed_view.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/inset_collapsed_view.dart index 8f56114c6..51f6c5d9f 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/inset_collapsed_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/inset_collapsed_view.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/widgets.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/local_peer_more_option.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/local_peer_more_option.dart index 3b1c5bf22..8155b41ed 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/local_peer_more_option.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/local_peer_more_option.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/more_option.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/more_option.dart index 6fe4fa69e..d7ddaa19f 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/more_option.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/more_option.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/name_and_network.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/name_and_network.dart index dbf4a4575..d87af295f 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/name_and_network.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/name_and_network.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/network_icon_widget.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/network_icon_widget.dart index 266fce857..eb82c7907 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/network_icon_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/network_icon_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart index 571d37a0b..e932bde45 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/screen_share_tile_name.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/screen_share_tile_name.dart index 4c856bee7..f86a0a787 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/screen_share_tile_name.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/screen_share_tile_name.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_creator_summary.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_creator_summary.dart index c427236aa..3b60af0bd 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_creator_summary.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_creator_summary.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_entry_widget.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_entry_widget.dart index 3b5e43d3b..ae7814d66 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_entry_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_entry_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + 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/leaderboard_widgets/leaderboard_rankings.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings.dart index 5856f8465..e0b6fde42 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:math' as math; ////Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings_list.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings_list.dart index b3b06ce32..ff4e9fb76 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings_list.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_rankings_list.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_voter_summary.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_voter_summary.dart index fa2029f76..3f0db1e67 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_voter_summary.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_voter_summary.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/quiz_leaderboard.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/quiz_leaderboard.dart index 927869ebc..7e655e067 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/quiz_leaderboard.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/quiz_leaderboard.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart index 61f64636d..7e428b869 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports 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 4d58d6a2b..362232938 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,4 +1,6 @@ ///Package imports +library; + import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_bottom_sheet.dart index fe52311d3..caed682db 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_bottom_sheet.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_card.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_card.dart index 3ca932391..1bf23b501 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_card.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_question_card.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_quiz_form.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_quiz_form.dart index f3974efe6..25367a7f4 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_quiz_form.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/poll_quiz_form.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hms_room_kit/src/widgets/poll_widgets/poll_creation_widgets/poll_question_bottom_sheet.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/saved_question_widget.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/saved_question_widget.dart index ad5493815..4712e6f7e 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/saved_question_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_creation_widgets/saved_question_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_button.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_button.dart index f855b12e2..2296e11cc 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/poll_quiz_selection_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/flutter_svg.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 3c09e7225..3aeccf209 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,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/poll_widgets/quiz_creation_widgets/create_quiz_form.dart b/packages/hms_room_kit/lib/src/widgets/poll_widgets/quiz_creation_widgets/create_quiz_form.dart index 9beabf28b..4ec7b0dd3 100644 --- a/packages/hms_room_kit/lib/src/widgets/poll_widgets/quiz_creation_widgets/create_quiz_form.dart +++ b/packages/hms_room_kit/lib/src/widgets/poll_widgets/quiz_creation_widgets/create_quiz_form.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; 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 22beb904d..ab2903199 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,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; 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 d45c45c43..ca56234c4 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,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart b/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart index f204c2e41..65edabab7 100644 --- a/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart +++ b/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart index 55d54e0b1..2fb1ccfb6 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import "dart:math" as math; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_disconnected_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_disconnected_toast.dart index bd596234f..9852bedd5 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_disconnected_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_disconnected_toast.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_error_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_error_toast.dart index db37eb076..a53d40534 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_error_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_error_toast.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:math' as math; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_local_screen_share_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_local_screen_share_toast.dart index a50e92ad0..87d1cb79f 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_local_screen_share_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_local_screen_share_toast.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_poll_start_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_poll_start_toast.dart index 2d175497b..1d39280a7 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_poll_start_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_poll_start_toast.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import 'dart:math' as math; import 'package:flutter/material.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_reconnection_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_reconnection_toast.dart index 2715fd9c3..f98141898 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_reconnection_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_reconnection_toast.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_recording_error_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_recording_error_toast.dart index ff1ec73be..8d2c41e7d 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_recording_error_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_recording_error_toast.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_role_change_decline_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_role_change_decline_toast.dart index 7276412c9..12dd6f794 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_role_change_decline_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_role_change_decline_toast.dart @@ -1,4 +1,6 @@ ///Dart imports +library; + import "dart:math" as math; ///Package imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_streaming_error_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_streaming_error_toast.dart new file mode 100644 index 000000000..c376ae076 --- /dev/null +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_streaming_error_toast.dart @@ -0,0 +1,58 @@ +///Package imports +library; + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:hmssdk_flutter/hmssdk_flutter.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/widgets/common_widgets/hms_subheading_text.dart'; +import 'package:hms_room_kit/src/widgets/toasts/hms_toast.dart'; +import 'package:hms_room_kit/src/widgets/toasts/hms_toasts_type.dart'; + +///[HMSRecordingErrorToast] renders the toast when recording fails to start +class HMSStreamingErrorToast extends StatelessWidget { + final HMSException streamingError; + final MeetingStore meetingStore; + final Color? toastColor; + final double? toastPosition; + const HMSStreamingErrorToast( + {super.key, + required this.streamingError, + required this.meetingStore, + this.toastColor, + this.toastPosition}); + + @override + Widget build(BuildContext context) { + return HMSToast( + toastColor: toastColor, + toastPosition: toastPosition, + leading: SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/recording_error.svg", + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), + ), + subtitle: HMSSubheadingText( + text: "Streaming failed to start", + textColor: HMSThemeColors.onSurfaceHighEmphasis, + fontWeight: FontWeight.w600, + letterSpacing: 0.1, + ), + cancelToastButton: IconButton( + icon: Icon( + Icons.close, + color: HMSThemeColors.onSurfaceHighEmphasis, + size: 24, + ), + onPressed: () { + meetingStore.removeToast(HMSToastsType.streamingErrorToast); + }, + ), + ); + } +} diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast.dart index 392fd66bc..c2efa3e2c 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_button.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_button.dart index 66afa308f..6d8b62ecb 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_button.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_button.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_model.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_model.dart index c74f1907c..1e379e942 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_model.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toast_model.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/cupertino.dart'; ///Project imports diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toasts_type.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toasts_type.dart index 491fb7430..d617daace 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_toasts_type.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_toasts_type.dart @@ -6,5 +6,6 @@ enum HMSToastsType { roleChangeDeclineToast, chatPauseResumeToast, errorToast, - pollStartedToast + pollStartedToast, + streamingErrorToast } diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/toast_widget.dart b/packages/hms_room_kit/lib/src/widgets/toasts/toast_widget.dart index 6607376d6..2ae64da65 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/toast_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/toast_widget.dart @@ -1,4 +1,6 @@ ///Package imports +library; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index e6ad3ac8b..5ac5569a8 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: "direct main" description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -158,14 +158,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" flutter_svg: dependency: "direct main" description: @@ -204,10 +196,10 @@ packages: dependency: "direct main" description: name: hmssdk_flutter - sha256: "2f689fad643f851447b2e95b55547cead6852fc6678c3c39fc62fb016754053e" + sha256: "3155ccd29881cd7ed36edf12db9f0355a586e78ae2c1249e6ca545ccdce73bc6" url: "https://pub.dev" source: hosted - version: "1.9.12" + version: "1.9.13" http: dependency: transitive description: @@ -240,6 +232,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" linkify: dependency: transitive description: @@ -249,13 +265,13 @@ packages: source: hosted version: "5.0.0" lints: - dependency: transitive + dependency: "direct dev" description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" lottie: dependency: "direct main" description: @@ -268,26 +284,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -308,10 +324,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_parsing: dependency: transitive description: @@ -444,10 +460,10 @@ packages: dependency: "direct main" description: name: provider - sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.1.2" share_plus: dependency: "direct main" description: @@ -545,18 +561,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -577,10 +593,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: "direct main" description: @@ -709,14 +725,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.2" - web: + vm_service: dependency: transitive description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "13.0.0" win32: dependency: transitive description: @@ -742,5 +758,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index 901ac89fb..afb16c773 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -1,6 +1,6 @@ name: hms_room_kit description: 100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps. -version: 1.0.15 +version: 1.0.16 homepage: https://www.100ms.live/ repository: https://github.com/100mslive/100ms-flutter issue_tracker: https://github.com/100mslive/100ms-flutter/issues @@ -14,7 +14,7 @@ dependencies: flutter: sdk: flutter - hmssdk_flutter: 1.9.12 + hmssdk_flutter: 1.9.13 intl: ^0.18.0 permission_handler: ^11.0.0 provider: ^6.0.5 @@ -38,7 +38,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + lints: ^3.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/hmssdk_flutter/CHANGELOG.md b/packages/hmssdk_flutter/CHANGELOG.md index 3a3473e93..715adb4cd 100644 --- a/packages/hmssdk_flutter/CHANGELOG.md +++ b/packages/hmssdk_flutter/CHANGELOG.md @@ -5,12 +5,30 @@ | 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.13 - 2024-03-15 + +| Package | Version | +| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| hms_room_kit | 1.0.16 | +| hmssdk_flutter | 1.9.13 | + +### ✨ Added + +- Leave Room Immediately if App is Killed(iOS only) + + - HMSSDK automatically triggers `leave` method call when the iOS application is terminated. + +Updated to Android SDK 2.9.51 & iOS SDK 1.6.0 + +**Full Changelog**: [1.9.12...1.9.13](https://github.com/100mslive/100ms-flutter/compare/1.9.12...1.9.13) + + # 1.9.12 - 2024-03-04 | Package | Version | | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | hms_room_kit | 1.0.15 | -| hmssdk_flutter | 1.9.12 | +| hmssdk_flutter | 1.9.12 | ### ✨ Added diff --git a/packages/hmssdk_flutter/analysis_options.yaml b/packages/hmssdk_flutter/analysis_options.yaml new file mode 100644 index 000000000..c36c2c5d3 --- /dev/null +++ b/packages/hmssdk_flutter/analysis_options.yaml @@ -0,0 +1 @@ +include: package:lints/core.yaml 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 98a465499..28d5a5981 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 @@ -1577,7 +1577,11 @@ class HmssdkFlutterPlugin : private fun startScreenShare(result: Result) { androidScreenshareResult = result - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"), Context.RECEIVER_EXPORTED) + }else { + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) + } val mediaProjectionManager: MediaProjectionManager = activity.getSystemService( Context.MEDIA_PROJECTION_SERVICE, @@ -1642,7 +1646,11 @@ class HmssdkFlutterPlugin : ) { androidAudioShareResult = result mode = call.argument("audio_mixing_mode") - activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER")) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"), Context.RECEIVER_EXPORTED) + }else { + activity.applicationContext?.registerReceiver(activityBroadcastReceiver, IntentFilter("ACTIVITY_RECEIVER"),) + } val mediaProjectionManager: MediaProjectionManager? = activity.getSystemService( Context.MEDIA_PROJECTION_SERVICE, diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 89fa204ef..d2cc5e4ec 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -1,12 +1,12 @@ Board: https://100ms.atlassian.net/jira/software/projects/FLUT/boards/34/ -- Polls/Quizzes which are created and linked to a Room should show up on Prebuilt -https://100ms.atlassian.net/browse/FLUT-239 +- Skip preview screen based on flag in the layout API +https://100ms.atlassian.net/browse/FLUT-217 -- Participant summary is getting dispalyed for user who does not have create permission -https://100ms.atlassian.net/browse/FLUT-249 +- Leave Room immediately if app is killed on iOS +https://100ms.atlassian.net/browse/FLUT-181 -Room Kit: 1.0.15 -Core SDK: 1.9.12 -Android SDK: 2.9.4 -iOS SDK: 1.5.1 +Room Kit: 1.0.16 +Core SDK: 1.9.13 +Android SDK: 2.9.51 +iOS SDK: 1.6.0 \ No newline at end of file diff --git a/packages/hmssdk_flutter/example/android/Gemfile.lock b/packages/hmssdk_flutter/example/android/Gemfile.lock index 1c298052a..b992690c3 100644 --- a/packages/hmssdk_flutter/example/android/Gemfile.lock +++ b/packages/hmssdk_flutter/example/android/Gemfile.lock @@ -12,10 +12,10 @@ GEM tzinfo (~> 2.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - artifactory (3.0.15) + artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.894.0) + aws-partitions (1.896.0) aws-sdk-core (3.191.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) @@ -132,18 +132,18 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-firebaseappdistribution_v1alpha (0.2.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-iamcredentials_v1 (0.19.0) + google-apis-iamcredentials_v1 (0.20.0) google-apis-core (>= 0.14.0, < 2.a) google-apis-playcustomapp_v1 (0.15.0) google-apis-core (>= 0.14.0, < 2.a) - google-apis-storage_v1 (0.34.0) + google-apis-storage_v1 (0.35.0) google-apis-core (>= 0.14.0, < 2.a) - google-cloud-core (1.6.1) + google-cloud-core (1.7.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) - google-cloud-errors (1.3.1) + google-cloud-errors (1.4.0) google-cloud-storage (1.49.0) addressable (~> 2.8) digest-crc (~> 0.4) @@ -164,11 +164,11 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.7.1) - jwt (2.8.0) + jwt (2.8.1) base64 mini_magick (4.12.0) mini_mime (1.1.5) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 31e5ef8db..0677b8638 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdkVersion 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -30,9 +30,9 @@ android { defaultConfig { applicationId "live.hms.flutter" minSdkVersion 21 - targetSdkVersion 33 - versionCode 452 - versionName "1.5.152" + targetSdkVersion 34 + versionCode 456 + versionName "1.5.156" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Gemfile.lock b/packages/hmssdk_flutter/example/ios/Gemfile.lock index 4d2706bdc..293a6b71b 100644 --- a/packages/hmssdk_flutter/example/ios/Gemfile.lock +++ b/packages/hmssdk_flutter/example/ios/Gemfile.lock @@ -12,10 +12,10 @@ GEM tzinfo (~> 2.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - artifactory (3.0.15) + artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.894.0) + aws-partitions (1.896.0) aws-sdk-core (3.191.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) @@ -133,18 +133,18 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-firebaseappdistribution_v1alpha (0.2.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-iamcredentials_v1 (0.19.0) + google-apis-iamcredentials_v1 (0.20.0) google-apis-core (>= 0.14.0, < 2.a) google-apis-playcustomapp_v1 (0.15.0) google-apis-core (>= 0.14.0, < 2.a) - google-apis-storage_v1 (0.34.0) + google-apis-storage_v1 (0.35.0) google-apis-core (>= 0.14.0, < 2.a) - google-cloud-core (1.6.1) + google-cloud-core (1.7.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) - google-cloud-errors (1.3.1) + google-cloud-errors (1.4.0) google-cloud-storage (1.49.0) addressable (~> 2.8) digest-crc (~> 0.4) @@ -165,11 +165,11 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.7.1) - jwt (2.8.0) + jwt (2.8.1) base64 mini_magick (4.12.0) mini_mime (1.1.5) diff --git a/packages/hmssdk_flutter/example/ios/Podfile.lock b/packages/hmssdk_flutter/example/ios/Podfile.lock index 7c2107ea1..7bf8f756d 100644 --- a/packages/hmssdk_flutter/example/ios/Podfile.lock +++ b/packages/hmssdk_flutter/example/ios/Podfile.lock @@ -25,15 +25,15 @@ PODS: - Firebase/Performance (= 10.9.0) - firebase_core - Flutter - - FirebaseABTesting (10.21.0): + - FirebaseABTesting (10.22.0): - FirebaseCore (~> 10.0) - FirebaseCore (10.9.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreExtension (10.21.0): + - FirebaseCoreExtension (10.22.0): - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.21.0): + - FirebaseCoreInternal (10.22.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseCrashlytics (10.9.0): - FirebaseCore (~> 10.5) @@ -45,7 +45,7 @@ PODS: - PromisesObjC (~> 2.1) - FirebaseDynamicLinks (10.9.0): - FirebaseCore (~> 10.0) - - FirebaseInstallations (10.21.0): + - FirebaseInstallations (10.22.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) @@ -60,51 +60,58 @@ PODS: - GoogleUtilities/ISASwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - - FirebaseRemoteConfig (10.21.0): + - FirebaseRemoteConfig (10.22.0): - FirebaseABTesting (~> 10.0) - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - FirebaseSharedSwift (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseSessions (10.21.0): + - FirebaseSessions (10.22.0): - FirebaseCore (~> 10.5) - FirebaseCoreExtension (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.2) - GoogleUtilities/Environment (~> 7.10) - - nanopb (< 2.30910.0, >= 2.30908.0) + - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesSwift (~> 2.1) - - FirebaseSharedSwift (10.21.0) + - FirebaseSharedSwift (10.22.0) - Flutter (1.0.0) - flutter_foreground_task (0.0.1): - Flutter - - GoogleDataTransport (9.3.0): + - GoogleDataTransport (9.4.1): - GoogleUtilities/Environment (~> 7.7) - - nanopb (< 2.30910.0, >= 2.30908.0) + - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Environment (7.12.0): + - GoogleUtilities/Environment (7.13.0): + - GoogleUtilities/Privacy - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/ISASwizzler (7.12.0) - - GoogleUtilities/Logger (7.12.0): + - GoogleUtilities/ISASwizzler (7.13.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (7.13.0): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (7.12.0): + - GoogleUtilities/Privacy + - GoogleUtilities/MethodSwizzler (7.13.0): - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib (7.12.0)" - - GoogleUtilities/UserDefaults (7.12.0): + - GoogleUtilities/Privacy + - "GoogleUtilities/NSData+zlib (7.13.0)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (7.13.0) + - GoogleUtilities/UserDefaults (7.13.0): - GoogleUtilities/Logger + - GoogleUtilities/Privacy - HMSAnalyticsSDK (0.0.2) - HMSBroadcastExtensionSDK (0.0.9) - HMSHLSPlayerSDK (0.0.2): - HMSAnalyticsSDK (= 0.0.2) - - HMSSDK (1.5.1): + - HMSSDK (1.6.0): - HMSAnalyticsSDK (= 0.0.2) - HMSWebRTC (= 1.0.5116) - - hmssdk_flutter (1.9.12): + - hmssdk_flutter (1.9.13): - Flutter - HMSBroadcastExtensionSDK (= 0.0.9) - HMSHLSPlayerSDK (= 0.0.2) - - HMSSDK (= 1.5.1) + - HMSSDK (= 1.6.0) - HMSWebRTC (1.0.5116) - MTBBarcodeScanner (5.0.11) - nanopb (2.30909.1): @@ -217,26 +224,26 @@ SPEC CHECKSUMS: firebase_crashlytics: 9b80d1944507cc07fa1c4455797f7d2eb7c8873f firebase_dynamic_links: db9f2ebcc3ea646e76a1d3ee37e9e57890ff0a83 firebase_performance: d11d1fd9591547f6b75f325aaadd6550eaf7e090 - FirebaseABTesting: 40774deef367dcc7b736b6c26dd59ce0fab42f41 + FirebaseABTesting: 66d2594b36d4ff6e7d3c8719802100990de05857 FirebaseCore: b68d3616526ec02e4d155166bbafb8eca64af557 - FirebaseCoreExtension: 1c044fd46e95036cccb29134757c499613f3f564 - FirebaseCoreInternal: 43c1788eaeee9d1b97caaa751af567ce11010d00 + FirebaseCoreExtension: 6394c00b887d0bebadbc7049c464aa0cbddc5d41 + FirebaseCoreInternal: bca337352024b18424a61e478460547d46c4c753 FirebaseCrashlytics: b60329455285aff853e54139d8ddbfe1e5f2b9f9 FirebaseDynamicLinks: 8cb66c4f403aa6ddf86ff3bc3c383a652f344ce9 - FirebaseInstallations: 390ea1d10a4d02b20c965cbfd527ee9b3b412acb + FirebaseInstallations: 763814908793c0da14c18b3dcffdec71e29ed55e FirebasePerformance: eee2f5da94fd7e5d15487649f8fe10a90c87c174 - FirebaseRemoteConfig: 1dd5164b2183aff07c7726df6b0212ad5154c1fe - FirebaseSessions: 80c2bbdd28166267b3d132debe5f7531efdb00bc - FirebaseSharedSwift: 19b3f709993d6fa1d84941d41c01e3c4c11eab93 + FirebaseRemoteConfig: e1b992a94d3674dddbcaf5d0d31a0312156ceb1c + FirebaseSessions: cd97fb07674f3906619c871eefbd260a1546c9d3 + FirebaseSharedSwift: 48076404e6e52372290d15a07d2ed1d2f1754023 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817 - GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe - GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 + GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a + GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152 HMSAnalyticsSDK: 4d2a88a729b1eb42f3d25f217c28937ec318a5b7 HMSBroadcastExtensionSDK: d80fe325f6c928bd8e5176290b5a4b7ae15d6fbb HMSHLSPlayerSDK: 6a54ad4d12f3dc2270d1ecd24019d71282a4f6a3 - HMSSDK: ab468de17246fcc8d6315ea490e9d9b30431d6b3 - hmssdk_flutter: 8abef18f893ae1ee7d7ce936251c46d545e926b2 + HMSSDK: 8bb7d5c9d593c4c1a15bdd28dbbc6dbc9a46c8e8 + hmssdk_flutter: 35d1cb5147be29b64c513d42fa77347ba0ac0819 HMSWebRTC: ae54e9dd91b869051b283b43b14f57d43b7bf8e1 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 @@ -253,4 +260,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 9fb9f6e431a2c6c79942252e94b241ac7972ac90 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index aafa4ab44..560f513e2 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.152 + 1.5.156 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 452 + 456 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 82901d354..84bf1bd75 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -286,15 +286,15 @@ packages: path: "../../hms_room_kit" relative: true source: path - version: "1.0.15" + version: "1.0.16" hmssdk_flutter: dependency: transitive description: name: hmssdk_flutter - sha256: "2f689fad643f851447b2e95b55547cead6852fc6678c3c39fc62fb016754053e" + sha256: "3155ccd29881cd7ed36edf12db9f0355a586e78ae2c1249e6ca545ccdce73bc6" url: "https://pub.dev" source: hosted - version: "1.9.12" + version: "1.9.13" http: dependency: transitive description: @@ -563,10 +563,10 @@ packages: dependency: transitive description: name: provider - sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.1.2" qr_code_scanner: dependency: "direct main" description: diff --git a/packages/hmssdk_flutter/example/pubspec.yaml b/packages/hmssdk_flutter/example/pubspec.yaml index d3eb3d87c..5a37324cb 100644 --- a/packages/hmssdk_flutter/example/pubspec.yaml +++ b/packages/hmssdk_flutter/example/pubspec.yaml @@ -4,7 +4,7 @@ description: Demonstrates how to use the hmssdk_flutter plugin. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 1.9.12 +version: 1.9.13 environment: sdk: ">=2.16.0 <4.0.0" diff --git a/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift b/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift index b3004d459..b22c2d46b 100644 --- a/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift +++ b/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift @@ -1291,6 +1291,17 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene hlsStreamUrl = room.hlsStreamingState.variants.first?.url?.absoluteString } } + + /** + `willTerminateNotification` is not fired in all cases. When app is in background & then app is force closed then this notification is not fired resulting in `leave` method not being invoked. + */ + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: .main) { [weak self] _ in + if self?.hmsSDK?.room != nil { + self?.hmsSDK?.leave() + } + } let data = [ "event_name": "on_join_room", @@ -1662,5 +1673,6 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene removeHMSLogger() HMSPeerListIteratorAction.clearIteratorMap() setIsRoomAudioUnmutedLocally(isRoomAudioUnmuted: true) + NotificationCenter.default.removeObserver(self) } } diff --git a/packages/hmssdk_flutter/lib/assets/sdk-versions.json b/packages/hmssdk_flutter/lib/assets/sdk-versions.json index 2b6fba7c8..04ee73876 100644 --- a/packages/hmssdk_flutter/lib/assets/sdk-versions.json +++ b/packages/hmssdk_flutter/lib/assets/sdk-versions.json @@ -1,7 +1,7 @@ { - "flutter": "1.9.12", + "flutter": "1.9.13", "ios": "1.6.0", "iOSBroadcastExtension": "0.0.9", "iOSHLSPlayerSDK": "0.0.2", - "android": "2.9.4" + "android": "2.9.51" } diff --git a/packages/hmssdk_flutter/lib/src/model/hms_message_recipient.dart b/packages/hmssdk_flutter/lib/src/model/hms_message_recipient.dart index 76435247b..4407046ef 100644 --- a/packages/hmssdk_flutter/lib/src/model/hms_message_recipient.dart +++ b/packages/hmssdk_flutter/lib/src/model/hms_message_recipient.dart @@ -46,7 +46,7 @@ class HMSMessageRecipient { static List getRoles(List list) { List hmsRole = []; - if (list.length == 0) return hmsRole; + if (list.isEmpty) return hmsRole; list.forEach((element) { hmsRole.add(HMSRole.fromMap(element)); }); diff --git a/packages/hmssdk_flutter/lib/src/model/hms_publish_setting.dart b/packages/hmssdk_flutter/lib/src/model/hms_publish_setting.dart index 4cf2cf079..170213e5b 100644 --- a/packages/hmssdk_flutter/lib/src/model/hms_publish_setting.dart +++ b/packages/hmssdk_flutter/lib/src/model/hms_publish_setting.dart @@ -19,12 +19,14 @@ class HMSPublishSetting { List allowed; if (map.containsKey('allowed')) { allowed = map['allowed'].cast(); - } else + } else { allowed = []; + } HMSAudioSetting? audioSetting; - if (map.containsKey('audio')) + if (map.containsKey('audio')) { audioSetting = HMSAudioSetting.fromMap(map['audio']); + } HMSVideoSetting? videoSetting; if (map.containsKey('video')) { videoSetting = HMSVideoSetting.fromMap(map['video']); 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 7e00f466c..990dac0c4 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 @@ -4,7 +4,7 @@ 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; + final Duration? duration; final int questionId; final HMSPollQuestionType questionType; final int? selectedOption; @@ -14,7 +14,7 @@ class HMSPollAnswer { HMSPollAnswer({ this.answerText, - required this.duration, + this.duration, required this.questionId, required this.questionType, this.selectedOption, @@ -27,7 +27,8 @@ class HMSPollAnswer { factory HMSPollAnswer.fromMap(Map map) { return HMSPollAnswer( answerText: map['answer'], - duration: Duration(seconds: map['duration']), + duration: + map['duration'] != null ? Duration(seconds: map['duration']) : null, questionId: map['question_id'], questionType: HMSPollQuestionTypeValues.getHMSPollQuestionTypeFromString( map['question_type']), @@ -44,7 +45,7 @@ class HMSPollAnswer { Map toMap() { return { 'answer': answerText, - 'duration': duration.inSeconds, + 'duration': duration?.inSeconds, 'question_id': questionId, 'question_type': questionType.toString(), 'selected_option': selectedOption, diff --git a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_leaderboard_summary.dart b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_leaderboard_summary.dart index fc759f355..d8c0092e7 100644 --- a/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_leaderboard_summary.dart +++ b/packages/hmssdk_flutter/lib/src/model/polls/hms_poll_leaderboard_summary.dart @@ -15,7 +15,9 @@ class HMSPollLeaderboardSummary { factory HMSPollLeaderboardSummary.fromMap(Map map) { return HMSPollLeaderboardSummary( averageScore: map["average_score"], - averageTime: Duration(milliseconds: map["average_time"].toInt()), + averageTime: map["average_time"] != null + ? Duration(milliseconds: map["average_time"].toInt()) + : null, respondedCorrectlyPeersCount: map["responded_correctly_peers_count"], respondedPeersCount: map["responded_peers_count"], totalPeersCount: map["total_peers_count"]); diff --git a/packages/hmssdk_flutter/lib/src/service/platform_service.dart b/packages/hmssdk_flutter/lib/src/service/platform_service.dart index 340f446f2..7b9d1d1fe 100644 --- a/packages/hmssdk_flutter/lib/src/service/platform_service.dart +++ b/packages/hmssdk_flutter/lib/src/service/platform_service.dart @@ -283,11 +283,12 @@ abstract class PlatformService { data['current_audio_device']) : null; List availableAudioDevice = []; - if (data["available_audio_device"] != null) + if (data["available_audio_device"] != null) { for (var device in data["available_audio_device"]) { availableAudioDevice .add(HMSAudioDeviceValues.getHMSAudioDeviceFromName(device)); } + } notifyUpdateListeners(method, { 'current_audio_device': currentAudioDevice, @@ -395,11 +396,12 @@ abstract class PlatformService { event.data['current_audio_device']) : null; List availableAudioDevice = []; - if (event.data["available_audio_device"] != null) + if (event.data["available_audio_device"] != null) { for (var device in event.data["available_audio_device"]) { availableAudioDevice .add(HMSAudioDeviceValues.getHMSAudioDeviceFromName(device)); } + } notifyPreviewListeners(method, { 'current_audio_device': currentAudioDevice, diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 207cb2beb..bfac3fa40 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -83,6 +83,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + lints: + dependency: "direct dev" + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" matcher: dependency: transitive description: diff --git a/packages/hmssdk_flutter/pubspec.yaml b/packages/hmssdk_flutter/pubspec.yaml index 05a0d0f77..094babf67 100644 --- a/packages/hmssdk_flutter/pubspec.yaml +++ b/packages/hmssdk_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: hmssdk_flutter description: Add Real Time Audio & Video calls, Interactive Live Streaming & Recording, Chat, HLS, RTMP, PiP, CallKit, VoIP, Video conferencing, Stream Player & WebRTC-based communications API -version: 1.9.12 +version: 1.9.13 homepage: https://www.100ms.live/ repository: https://github.com/100mslive/100ms-flutter issue_tracker: https://github.com/100mslive/100ms-flutter/issues @@ -17,6 +17,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + lints: ^3.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/sample apps/mobx/lib/setup/hms_sdk_interactor.dart b/sample apps/mobx/lib/setup/hms_sdk_interactor.dart index 4c4273495..0ec0b1e31 100644 --- a/sample apps/mobx/lib/setup/hms_sdk_interactor.dart +++ b/sample apps/mobx/lib/setup/hms_sdk_interactor.dart @@ -124,7 +124,7 @@ class HMSSDKInteractor { Future getPeer({required String peerId}) async { List? peers = await hmsSDK.getPeers(); - return peers?.firstWhere((element) => element.peerId == peerId); + return peers.firstWhere((element) => element.peerId == peerId); } void changeTrackState(HMSTrack forRemoteTrack, bool mute,