diff --git a/packages/hms_room_kit/lib/src/assets/icons/everyone.svg b/packages/hms_room_kit/lib/src/assets/icons/everyone.svg
new file mode 100644
index 000000000..cd20fb16d
--- /dev/null
+++ b/packages/hms_room_kit/lib/src/assets/icons/everyone.svg
@@ -0,0 +1,14 @@
+
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 b5e81686c..53529c655 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,12 +1,7 @@
-//Dart imports
-
///Package imports
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:flutter_svg/flutter_svg.dart';
-import 'package:hms_room_kit/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart';
-import 'package:hms_room_kit/src/widgets/chat_widgets/chat_text_field.dart';
-import 'package:hms_room_kit/src/widgets/chat_widgets/pin_chat_widget.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
@@ -17,6 +12,10 @@ import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:hms_room_kit/src/enums/session_store_keys.dart';
import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart';
+import 'package:hms_room_kit/src/widgets/bottom_sheets/chat_utilities_bottom_sheet.dart';
+import 'package:hms_room_kit/src/widgets/chat_widgets/chat_text_field.dart';
+import 'package:hms_room_kit/src/widgets/chat_widgets/pin_chat_widget.dart';
+import 'package:hms_room_kit/src/widgets/chat_widgets/recipient_selector_chip.dart';
///[OverlayChatComponent] is a component that is used to show the chat
class OverlayChatComponent extends StatefulWidget {
@@ -29,6 +28,8 @@ class OverlayChatComponent extends StatefulWidget {
class _OverlayChatComponentState extends State {
final ScrollController _scrollController = ScrollController();
+ String currentlySelectedValue = "Choose a Recipient";
+ String? currentlySelectedpeerId;
@override
void dispose() {
@@ -36,6 +37,25 @@ class _OverlayChatComponentState extends State {
super.dispose();
}
+ @override
+ void initState() {
+ super.initState();
+ setRecipientChipValue();
+ }
+
+ ///This function sets the recipient chip value
+ void setRecipientChipValue() {
+ dynamic currentValue = context.read().recipientSelectorValue;
+ if (currentValue is HMSPeer) {
+ currentlySelectedValue = currentValue.name;
+ currentlySelectedpeerId = currentValue.peerId;
+ } else if (currentValue is HMSRole) {
+ currentlySelectedValue = currentValue.name;
+ } else if (currentValue is String) {
+ currentlySelectedValue = currentValue;
+ }
+ }
+
///This function scrolls to the end of the list
void _scrollToEnd() {
WidgetsBinding.instance.addPostFrameCallback((_) =>
@@ -44,13 +64,55 @@ class _OverlayChatComponentState extends State {
curve: Curves.easeInOut));
}
+ ///This function updates the selected value
+ void _updateValueChoose(String newValue, String? peerId) {
+ currentlySelectedValue = newValue;
+ currentlySelectedpeerId = peerId;
+ }
+
+ ///This function returns the message type text for public, group and private messages
+ String messageTypeText(HMSMessageRecipient? hmsMessageRecipient) {
+ if (hmsMessageRecipient == null) return "";
+ if ((hmsMessageRecipient.recipientPeer != null) &&
+ (hmsMessageRecipient.recipientRoles == null)) {
+ if (hmsMessageRecipient.recipientPeer is HMSLocalPeer) {
+ return "to You (DM)";
+ } else {
+ return "to ${hmsMessageRecipient.recipientPeer?.name} (DM)";
+ }
+ } else if ((hmsMessageRecipient.recipientPeer == null) &&
+ (hmsMessageRecipient.recipientRoles != null)) {
+ return "to ${hmsMessageRecipient.recipientRoles?.first.name} (Group)";
+ }
+ return "";
+ }
+
///This function sends the message
void _sendMessage(TextEditingController messageTextController) async {
MeetingStore meetingStore = context.read();
+ List hmsRoles = meetingStore.roles;
String message = messageTextController.text.trim();
if (message.isEmpty) return;
- meetingStore.sendBroadcastMessage(message);
- messageTextController.clear();
+
+ List rolesName = [];
+ for (int i = 0; i < hmsRoles.length; i++) {
+ rolesName.add(hmsRoles[i].name);
+ }
+
+ if (currentlySelectedValue == "Everyone") {
+ meetingStore.sendBroadcastMessage(message);
+ } else if (rolesName.contains(currentlySelectedValue)) {
+ List selectedRoles = [];
+ selectedRoles.add(
+ hmsRoles.firstWhere((role) => role.name == currentlySelectedValue));
+ meetingStore.sendGroupMessage(message, selectedRoles);
+ } else if (currentlySelectedpeerId != null &&
+ meetingStore.localPeer!.peerId != currentlySelectedpeerId) {
+ var peer = await meetingStore.getPeer(peerId: currentlySelectedpeerId!);
+ if (peer != null) {
+ meetingStore.sendDirectMessage(message, peer);
+ }
+ }
}
@override
@@ -80,13 +142,41 @@ class _OverlayChatComponentState extends State {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- HMSTitleText(
- text: data.item1[index].sender?.name ??
- "Anonymous",
- textColor: Colors.white,
- fontSize: 14,
- lineHeight: 20,
- letterSpacing: 0.1,
+ Row(
+ children: [
+ Container(
+ constraints: BoxConstraints(
+ maxWidth: MediaQuery.of(context)
+ .size
+ .width *
+ 0.5),
+ child: HMSTitleText(
+ text: data.item1[index].sender
+ ?.name ??
+ "Anonymous",
+ textColor: Colors.white,
+ fontSize: 14,
+ lineHeight: 20,
+ letterSpacing: 0.1,
+ ),
+ ),
+ const SizedBox(
+ width: 4,
+ ),
+ Container(
+ constraints: BoxConstraints(
+ maxWidth: MediaQuery.of(context)
+ .size
+ .width *
+ 0.5),
+ child: HMSSubtitleText(
+ text: messageTypeText(data
+ .item1[index]
+ .hmsMessageRecipient),
+ textColor: HMSThemeColors
+ .onSurfaceMediumEmphasis),
+ ),
+ ],
),
const SizedBox(
height: 2,
@@ -177,71 +267,11 @@ class _OverlayChatComponentState extends State {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- ///This will be added in future versions
- ///
- Row(
- children: [
- Padding(
- padding: const EdgeInsets.only(right: 8.0),
- child: HMSTitleText(
- text: "TO",
- textColor: HMSThemeColors
- .onSurfaceMediumEmphasis,
- fontSize: 12,
- fontWeight: FontWeight.w400,
- lineHeight: 16,
- letterSpacing: 0.4,
- ),
- ),
- Container(
- height: 24,
- decoration: BoxDecoration(
- borderRadius: const BorderRadius.all(
- Radius.circular(4)),
- color: HMSThemeColors.backgroundDim
- .withOpacity(0.64)),
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 4.0),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.center,
- children: [
- Padding(
- padding: const EdgeInsets.only(
- right: 4.0),
- child: SvgPicture.asset(
- "packages/hms_room_kit/lib/src/assets/icons/participants.svg",
- height: 16,
- width: 16,
- colorFilter: ColorFilter.mode(
- HMSThemeColors
- .onSurfaceMediumEmphasis,
- BlendMode.srcIn),
- ),
- ),
- HMSTitleText(
- text: "Everyone",
- fontSize: 12,
- lineHeight: 16,
- letterSpacing: 0.4,
- fontWeight: FontWeight.w400,
- textColor: HMSThemeColors
- .onPrimaryHighEmphasis),
- Padding(
- padding: const EdgeInsets.only(
- left: 4.0),
- child: Icon(
- Icons.keyboard_arrow_down,
- color: HMSThemeColors
- .onPrimaryHighEmphasis,
- size: 12,
- ),
- ),
- ],
- ),
- ))
- ],
+ ReceipientSelectorChip(
+ currentlySelectedValue: currentlySelectedValue,
+ updateSelectedValue: _updateValueChoose,
+ chipColor:
+ HMSThemeColors.backgroundDim.withAlpha(64),
),
const SizedBox(),
if (HMSRoomLayout.chatData?.realTimeControls
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 78b50a72f..1f3563417 100644
--- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart
+++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart
@@ -185,6 +185,9 @@ class MeetingStore extends ChangeNotifier
///[blackListedUserIds] is the list of user ids which are blacklisted from chat
List blackListedUserIds = [];
+ ///[recipientSelectorValue] is the value of the recipient selector chip
+ dynamic recipientSelectorValue = "Choose a Recipient";
+
bool isPipActive = false;
// bool isPipAutoEnabled = true;
@@ -279,6 +282,7 @@ class MeetingStore extends ChangeNotifier
WidgetsBinding.instance.addObserver(this);
setMeetingModeUsingLayoutApi();
_hmsSDKInteractor.join(config: roomConfig);
+ setRecipientSelectorValue();
meetingUrl = roomCode;
return null;
}
@@ -1367,6 +1371,12 @@ class MeetingStore extends ChangeNotifier
participantsInMeetingMap["Hand Raised"]
?.removeWhere((oldPeer) => oldPeer.peer.peerId == peer.peerId);
}
+
+ ///If peer is removed from room but selected in the recipient selector
+ ///we reset it to "Choose a Recipient"
+ if (recipientSelectorValue == peer) {
+ recipientSelectorValue = "Choose a Recipient";
+ }
notifyListeners();
}
@@ -2001,6 +2011,26 @@ class MeetingStore extends ChangeNotifier
metadata: data);
}
+ ///[setReipientSelectorValue] method is used to set the value of recipient selector
+ void setRecipientSelectorValue() {
+ if (HMSRoomLayout.chatData?.isPublicChatEnabled ?? false) {
+ recipientSelectorValue = "Everyone";
+ return;
+ } else if (HMSRoomLayout.chatData?.rolesWhitelist.isNotEmpty ?? false) {
+ if (localPeer != null) {
+ recipientSelectorValue = HMSRoomLayout.chatData?.rolesWhitelist
+ .firstWhere((role) => role != localPeer?.role.name) ??
+ localPeer!.role.name;
+ return;
+ }
+ } else if (HMSRoomLayout.chatData?.isPrivateChatEnabled ?? false) {
+ if (peers.length > 1) {
+ recipientSelectorValue = peers[1];
+ }
+ }
+ notifyListeners();
+ }
+
void getSessionMetadata(String key) async {
dynamic result = await _hmsSessionStore?.getSessionMetadataForKey(key: key);
if (result is HMSException) {
diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_bottom_sheet.dart
index 485185b59..4269f4b59 100644
--- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_bottom_sheet.dart
+++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/chat_bottom_sheet.dart
@@ -1,9 +1,5 @@
//Package imports
import 'package:flutter/material.dart';
-import 'package:hms_room_kit/hms_room_kit.dart';
-import 'package:hms_room_kit/src/widgets/toasts/hms_error_toast.dart';
-import 'package:hms_room_kit/src/widgets/toasts/hms_toast_model.dart';
-import 'package:hms_room_kit/src/widgets/toasts/hms_toasts_type.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
@@ -15,6 +11,11 @@ import 'package:hms_room_kit/src/widgets/common_widgets/message_container.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:hms_room_kit/src/widgets/chat_widgets/chat_text_field.dart';
import 'package:hms_room_kit/src/widgets/chat_widgets/pin_chat_widget.dart';
+import 'package:hms_room_kit/hms_room_kit.dart';
+import 'package:hms_room_kit/src/widgets/chat_widgets/recipient_selector_chip.dart';
+import 'package:hms_room_kit/src/widgets/toasts/hms_error_toast.dart';
+import 'package:hms_room_kit/src/widgets/toasts/hms_toast_model.dart';
+import 'package:hms_room_kit/src/widgets/toasts/hms_toasts_type.dart';
///[ChatBottomSheet] is a bottom sheet that is used to render the bottom sheet for chat
class ChatBottomSheet extends StatefulWidget {
@@ -26,9 +27,12 @@ class ChatBottomSheet extends StatefulWidget {
class _ChatBottomSheetState extends State {
late double widthOfScreen;
- String valueChoose = "Everyone";
+ String currentlySelectedValue = "Choose a Recipient";
+ String? currentlySelectedpeerId;
+
final ScrollController _scrollController = ScrollController();
final DateFormat formatter = DateFormat('hh:mm a');
+
@override
void dispose() {
_scrollController.dispose();
@@ -44,6 +48,25 @@ class _ChatBottomSheetState extends State {
}
}
+ @override
+ void initState() {
+ super.initState();
+ setRecipientChipValue();
+ }
+
+ ///This function sets the value of the recipient chip
+ void setRecipientChipValue() {
+ dynamic currentValue = context.read().recipientSelectorValue;
+ if (currentValue is HMSPeer) {
+ currentlySelectedValue = currentValue.name;
+ currentlySelectedpeerId = currentValue.peerId;
+ } else if (currentValue is HMSRole) {
+ currentlySelectedValue = currentValue.name;
+ } else if (currentValue is String) {
+ currentlySelectedValue = currentValue;
+ }
+ }
+
void sendMessage(TextEditingController messageTextController) async {
MeetingStore meetingStore = context.read();
List hmsRoles = meetingStore.roles;
@@ -55,19 +78,27 @@ class _ChatBottomSheetState extends State {
rolesName.add(hmsRoles[i].name);
}
- if (valueChoose == "Everyone") {
+ if (currentlySelectedValue == "Everyone") {
meetingStore.sendBroadcastMessage(message);
- } else if (rolesName.contains(valueChoose)) {
+ } else if (rolesName.contains(currentlySelectedValue)) {
List selectedRoles = [];
- selectedRoles
- .add(hmsRoles.firstWhere((role) => role.name == valueChoose));
+ selectedRoles.add(
+ hmsRoles.firstWhere((role) => role.name == currentlySelectedValue));
meetingStore.sendGroupMessage(message, selectedRoles);
- } else if (meetingStore.localPeer!.peerId != valueChoose) {
- var peer = await meetingStore.getPeer(peerId: valueChoose);
- meetingStore.sendDirectMessage(message, peer!);
+ } else if (currentlySelectedpeerId != null &&
+ meetingStore.localPeer!.peerId != currentlySelectedpeerId) {
+ var peer = await meetingStore.getPeer(peerId: currentlySelectedpeerId!);
+ if (peer != null) {
+ meetingStore.sendDirectMessage(message, peer);
+ }
}
}
+ void _updateValueChoose(String newValue, String? peerId) {
+ currentlySelectedValue = newValue;
+ currentlySelectedpeerId = peerId;
+ }
+
@override
Widget build(BuildContext context) {
widthOfScreen = MediaQuery.of(context).size.width;
@@ -137,65 +168,9 @@ class _ChatBottomSheetState extends State {
),
/// This draws the chip to select the roles or peers to send message to
- // Padding(
- // padding: const EdgeInsets.only(bottom: 8.0, top: 16),
- // child: Row(
- // children: [
- // Padding(
- // padding: const EdgeInsets.only(right: 8.0),
- // child: HMSTitleText(
- // text: "TO",
- // textColor: HMSThemeColors.onSurfaceMediumEmphasis,
- // fontSize: 12,
- // fontWeight: FontWeight.w400,
- // lineHeight: 16,
- // letterSpacing: 0.4,
- // ),
- // ),
- // Container(
- // height: 24,
- // decoration: BoxDecoration(
- // borderRadius:
- // const BorderRadius.all(Radius.circular(4)),
- // color: HMSThemeColors.primaryDefault),
- // child: Padding(
- // padding: const EdgeInsets.symmetric(horizontal: 4.0),
- // child: Row(
- // mainAxisAlignment: MainAxisAlignment.center,
- // children: [
- // Padding(
- // padding: const EdgeInsets.only(right: 4.0),
- // child: SvgPicture.asset(
- // "packages/hms_room_kit/lib/src/assets/icons/participants.svg",
- // height: 16,
- // width: 16,
- // colorFilter: ColorFilter.mode(
- // HMSThemeColors.onSurfaceMediumEmphasis,
- // BlendMode.srcIn),
- // ),
- // ),
- // HMSTitleText(
- // text: valueChoose,
- // fontSize: 12,
- // lineHeight: 16,
- // letterSpacing: 0.4,
- // fontWeight: FontWeight.w400,
- // textColor:
- // HMSThemeColors.onPrimaryHighEmphasis),
- // Padding(
- // padding: const EdgeInsets.only(left: 4.0),
- // child: Icon(
- // Icons.keyboard_arrow_down,
- // color: HMSThemeColors.onPrimaryHighEmphasis,
- // size: 12,
- // ),
- // ),
- // ],
- // ),
- // ))
- // ],
- // ),
- // ),
+ ReceipientSelectorChip(
+ currentlySelectedValue: currentlySelectedValue,
+ updateSelectedValue: _updateValueChoose),
///Text Field
ChatTextField(sendMessage: sendMessage)
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 4aca9a14a..21a089bd4 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
@@ -463,13 +463,16 @@ class _ParticipantsBottomSheetState extends State {
builder: (_,
peerName,
__) {
- return HMSTitleText(
- text:
- peerName + ((participantsPerRole.item2![peerIndex].peer.isLocal) ? " (You)" : ""),
- fontSize: 14,
- lineHeight: 20,
- letterSpacing: 0.1,
- textColor: HMSThemeColors.onSurfaceHighEmphasis);
+ return Container(
+ constraints:
+ BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
+ child: HMSTitleText(
+ text: peerName + ((participantsPerRole.item2![peerIndex].peer.isLocal) ? " (You)" : ""),
+ fontSize: 14,
+ lineHeight: 20,
+ letterSpacing: 0.1,
+ textColor: HMSThemeColors.onSurfaceHighEmphasis),
+ );
}),
///This contains the network quality, hand raise icon and kebab menu
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 7127f70db..133b4d363 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
@@ -90,85 +90,102 @@ class _ChatTextFieldState extends State {
Expanded(
child: Container(
color: HMSThemeColors.surfaceDefault,
- child: TextField(
- textCapitalization:
- TextCapitalization.sentences,
- textInputAction: TextInputAction.send,
- onTapOutside: (event) => FocusManager
- .instance.primaryFocus
- ?.unfocus(),
- onSubmitted: (value) {
- widget
- .sendMessage(messageTextController);
- messageTextController.clear();
- },
- onChanged: (value) {
- setState(() {});
- },
- style: HMSTextStyle.setTextStyle(
- color: HMSThemeColors
- .onSurfaceHighEmphasis,
- fontWeight: FontWeight.w400,
- height: 20 / 14,
- fontSize: 14,
- letterSpacing: 0.25),
- controller: messageTextController,
- decoration: InputDecoration(
- suffixIcon: IconButton(
- splashRadius: 1,
- onPressed: () {
- if (messageTextController.text
- .trim()
- .isEmpty) {
- Utilities.showToast(
- "Message can't be empty");
- }
- widget.sendMessage(
- messageTextController);
- messageTextController.clear();
- },
- icon: SvgPicture.asset(
- "packages/hms_room_kit/lib/src/assets/icons/send_message.svg",
- height: 24,
- width: 24,
- colorFilter: ColorFilter.mode(
- messageTextController.text
- .trim()
- .isEmpty
- ? HMSThemeColors
- .onSurfaceLowEmphasis
- : HMSThemeColors
- .onSurfaceHighEmphasis,
- BlendMode.srcIn),
- )),
- border: InputBorder.none,
- focusedBorder: OutlineInputBorder(
- borderSide: BorderSide(
- width: 2,
- color: HMSThemeColors
- .primaryDefault),
- borderRadius:
- const BorderRadius.all(
- Radius.circular(8))),
- enabledBorder: InputBorder.none,
- errorBorder: InputBorder.none,
- disabledBorder: InputBorder.none,
- hintStyle: HMSTextStyle.setTextStyle(
- color: HMSThemeColors
- .onSurfaceLowEmphasis,
- fontSize: 14,
- height: 20 / 14,
- letterSpacing: 0.25,
- fontWeight: FontWeight.w400),
- contentPadding: const EdgeInsets.only(
- left: 16,
- bottom: 8,
- top: 12,
- right: 8),
- hintText: HMSRoomLayout.chatData
- ?.messagePlaceholder ??
- "Send a message..."),
- ),
+ child: Selector(
+ selector: (_, meetingStore) =>
+ meetingStore.recipientSelectorValue,
+ builder: (_, selectedValue, __) {
+ return TextField(
+ enabled: selectedValue !=
+ "Choose a Recipient",
+ textCapitalization:
+ TextCapitalization.sentences,
+ textInputAction:
+ TextInputAction.send,
+ onTapOutside: (event) =>
+ FocusManager
+ .instance.primaryFocus
+ ?.unfocus(),
+ onSubmitted: (value) {
+ widget.sendMessage(
+ messageTextController);
+ messageTextController.clear();
+ },
+ onChanged: (value) {
+ setState(() {});
+ },
+ style: HMSTextStyle.setTextStyle(
+ color: HMSThemeColors
+ .onSurfaceHighEmphasis,
+ fontWeight: FontWeight.w400,
+ height: 20 / 14,
+ fontSize: 14,
+ letterSpacing: 0.25),
+ controller: messageTextController,
+ decoration: InputDecoration(
+ suffixIcon: IconButton(
+ splashRadius: 1,
+ onPressed: () {
+ if (messageTextController
+ .text
+ .trim()
+ .isEmpty) {
+ Utilities.showToast(
+ "Message can't be empty");
+ }
+ widget.sendMessage(
+ messageTextController);
+ messageTextController
+ .clear();
+ },
+ icon: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/send_message.svg",
+ height: 24,
+ width: 24,
+ colorFilter: ColorFilter.mode(
+ messageTextController
+ .text
+ .trim()
+ .isEmpty
+ ? HMSThemeColors
+ .onSurfaceLowEmphasis
+ : HMSThemeColors
+ .onSurfaceHighEmphasis,
+ BlendMode.srcIn),
+ )),
+ border: InputBorder.none,
+ focusedBorder: OutlineInputBorder(
+ borderSide: BorderSide(
+ width: 2,
+ color: HMSThemeColors
+ .primaryDefault),
+ borderRadius:
+ const BorderRadius.all(
+ Radius.circular(
+ 8))),
+ enabledBorder: InputBorder.none,
+ errorBorder: InputBorder.none,
+ disabledBorder:
+ InputBorder.none,
+ hintStyle:
+ HMSTextStyle.setTextStyle(
+ color: HMSThemeColors
+ .onSurfaceLowEmphasis,
+ fontSize: 14,
+ height: 20 / 14,
+ letterSpacing: 0.25,
+ fontWeight:
+ FontWeight.w400),
+ contentPadding:
+ const EdgeInsets.only(
+ left: 16,
+ bottom: 8,
+ top: 12,
+ right: 8),
+ hintText: HMSRoomLayout.chatData
+ ?.messagePlaceholder ??
+ "Send a message..."),
+ );
+ }),
),
)
],
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
new file mode 100644
index 000000000..9092f04ae
--- /dev/null
+++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_chip.dart
@@ -0,0 +1,143 @@
+///Package imports
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:hmssdk_flutter/hmssdk_flutter.dart';
+import 'package:provider/provider.dart';
+
+///Project imports
+import 'package:hms_room_kit/hms_room_kit.dart';
+import 'package:hms_room_kit/src/meeting/meeting_store.dart';
+import 'package:hms_room_kit/src/widgets/chat_widgets/recipient_selector_widget.dart';
+
+///[ReceipientSelectorChip] is a widget that is used to render the receipient selector chip
+class ReceipientSelectorChip extends StatefulWidget {
+ final String currentlySelectedValue;
+ final Function updateSelectedValue;
+ final Color? chipColor;
+
+ const ReceipientSelectorChip(
+ {Key? key,
+ required this.currentlySelectedValue,
+ required this.updateSelectedValue,
+ this.chipColor})
+ : super(key: key);
+ @override
+ State createState() => _ReceipientSelectorChipState();
+}
+
+class _ReceipientSelectorChipState extends State {
+ String currentlySelectedValue = "";
+
+ @override
+ void initState() {
+ super.initState();
+ currentlySelectedValue = widget.currentlySelectedValue;
+ }
+
+ void setSelectedValue() {
+ currentlySelectedValue = "Choose a Recipient";
+ }
+
+ void _updateValueChoose(String newValue, String? peerId) {
+ setState(() {
+ currentlySelectedValue = newValue;
+ });
+ widget.updateSelectedValue(newValue, peerId);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: () => showModalBottomSheet(
+ isScrollControlled: true,
+ backgroundColor: Colors.transparent,
+ context: context,
+ builder: (ctx) => ChangeNotifierProvider.value(
+ value: context.read(),
+ child: RecipientSelectorWidget(
+ updateUI: _updateValueChoose,
+ selectedValue: currentlySelectedValue,
+ ))),
+ child: Padding(
+ padding: const EdgeInsets.only(bottom: 8.0, top: 16),
+ child: Row(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(right: 8.0),
+ child: HMSTitleText(
+ text: "TO",
+ textColor: HMSThemeColors.onSurfaceMediumEmphasis,
+ fontSize: 12,
+ fontWeight: FontWeight.w400,
+ lineHeight: 16,
+ letterSpacing: 0.4,
+ ),
+ ),
+ Container(
+ height: 24,
+ decoration: BoxDecoration(
+ borderRadius: const BorderRadius.all(Radius.circular(4)),
+ color: widget.chipColor ?? HMSThemeColors.primaryDefault),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4.0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(right: 4.0),
+ child: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/participants.svg",
+ height: 16,
+ width: 16,
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors.onSurfaceMediumEmphasis,
+ BlendMode.srcIn),
+ ),
+ ),
+ Container(
+ constraints: BoxConstraints(
+ maxWidth: MediaQuery.of(context).size.width * 0.5,
+ ),
+ child: Selector(
+ selector: (_, meetingStore) =>
+ meetingStore.recipientSelectorValue,
+ builder: (_, currentValue, __) {
+ ///Here we set the currentValue based on meetingStore.recipientSelectorValue
+ ///This is to handle a case where a peer is selected but the peer leaves
+ ///So we set the chip selection again to "Choose a Recipient"
+ if (currentValue is HMSPeer) {
+ currentlySelectedValue = currentValue.name;
+ } else if (currentValue is HMSRole) {
+ currentlySelectedValue = currentValue.name;
+ } else if (currentValue is String) {
+ currentlySelectedValue = currentValue;
+ }
+
+ return HMSTitleText(
+ text: currentlySelectedValue,
+ textOverflow: TextOverflow.ellipsis,
+ fontSize: 12,
+ lineHeight: 16,
+ letterSpacing: 0.4,
+ fontWeight: FontWeight.w400,
+ textColor:
+ HMSThemeColors.onPrimaryHighEmphasis);
+ }),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(left: 4.0),
+ child: Icon(
+ Icons.keyboard_arrow_down,
+ color: HMSThemeColors.onPrimaryHighEmphasis,
+ size: 12,
+ ),
+ ),
+ ],
+ ),
+ ))
+ ],
+ ),
+ ),
+ );
+ }
+}
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
new file mode 100644
index 000000000..dc577bd03
--- /dev/null
+++ b/packages/hms_room_kit/lib/src/widgets/chat_widgets/recipient_selector_widget.dart
@@ -0,0 +1,344 @@
+///Package imports
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/svg.dart';
+import 'package:hmssdk_flutter/hmssdk_flutter.dart';
+import 'package:provider/provider.dart';
+import 'package:tuple/tuple.dart';
+
+///Project imports
+import 'package:hms_room_kit/hms_room_kit.dart';
+import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart';
+import 'package:hms_room_kit/src/meeting/meeting_store.dart';
+import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart';
+
+///[ReceipientSelectorChip] is a widget that is used to render the receipient selector chip
+class RecipientSelectorWidget extends StatefulWidget {
+ final Function updateUI;
+ final String selectedValue;
+
+ const RecipientSelectorWidget(
+ {super.key, required this.updateUI, required this.selectedValue});
+
+ @override
+ State createState() =>
+ _RecipientSelectorWidgetState();
+}
+
+class _RecipientSelectorWidgetState extends State {
+ String currentlySelectedValue = "";
+
+ @override
+ void initState() {
+ super.initState();
+ currentlySelectedValue = widget.selectedValue;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return DraggableScrollableSheet(
+ maxChildSize: 0.7,
+ builder: (context, controller) {
+ return Container(
+ decoration: BoxDecoration(
+ borderRadius: const BorderRadius.only(
+ topLeft: Radius.circular(16), topRight: Radius.circular(16)),
+ color: HMSThemeColors.surfaceDefault,
+ ),
+ child: Column(
+ children: [
+ Column(
+ children: [
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 24.0, right: 24, top: 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ HMSTitleText(
+ text: "Send message to",
+ textColor: HMSThemeColors.onSurfaceHighEmphasis,
+ letterSpacing: 0.15,
+ ),
+ HMSCrossButton(
+ iconColor: HMSThemeColors.onSecondaryMediumEmphasis,
+ )
+ ],
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 12.0),
+ child: Divider(
+ height: 1,
+ color: HMSThemeColors.borderBright,
+ ),
+ ),
+ ],
+ ),
+
+ ///TODO: Add search bar here
+
+ Expanded(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ if (HMSRoomLayout.chatData?.isPublicChatEnabled ??
+ false)
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 24.0, right: 24),
+ child: ListTile(
+ onTap: () {
+ setState(() {
+ currentlySelectedValue = "Everyone";
+ });
+ widget.updateUI(currentlySelectedValue, null);
+ context
+ .read()
+ .recipientSelectorValue = "Everyone";
+ Navigator.pop(context);
+ },
+ dense: true,
+ horizontalTitleGap: 0,
+ contentPadding: EdgeInsets.zero,
+ titleAlignment: ListTileTitleAlignment.center,
+ leading: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/everyone.svg",
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors.onSurfaceMediumEmphasis,
+ BlendMode.srcIn),
+ width: 20,
+ height: 20,
+ ),
+ title: HMSTitleText(
+ text: "Everyone",
+ textColor: HMSThemeColors.onSurfaceHighEmphasis,
+ fontSize: 14,
+ letterSpacing: 0.1,
+ lineHeight: 20,
+ ),
+ trailing: currentlySelectedValue == "Everyone"
+ ? SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/tick.svg",
+ fit: BoxFit.scaleDown,
+ height: 20,
+ width: 20,
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors.onSurfaceHighEmphasis,
+ BlendMode.srcIn),
+ )
+ : const SizedBox(),
+ ),
+ ),
+
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 6.0),
+ child: Divider(
+ height: 1,
+ color: HMSThemeColors.borderBright,
+ ),
+ ),
+
+ ///Group based selection
+ if (HMSRoomLayout.chatData?.rolesWhitelist.isNotEmpty ??
+ false)
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 24.0, right: 24),
+ child: ListTile(
+ dense: true,
+ horizontalTitleGap: 0,
+ contentPadding: EdgeInsets.zero,
+ titleAlignment: ListTileTitleAlignment.center,
+ leading: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/participants.svg",
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors.onSurfaceMediumEmphasis,
+ BlendMode.srcIn),
+ width: 20,
+ height: 20,
+ ),
+ title: HMSTitleText(
+ text: "ROLE GROUP",
+ textColor:
+ HMSThemeColors.onSurfaceMediumEmphasis,
+ fontSize: 10,
+ letterSpacing: 1.5,
+ lineHeight: 16,
+ ),
+ ),
+ ),
+
+ if (HMSRoomLayout.chatData?.rolesWhitelist.isNotEmpty ??
+ false)
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 10.0, right: 10),
+ child: Column(
+ children: HMSRoomLayout.chatData!.rolesWhitelist
+ .map((roleName) => ListTile(
+ onTap: () {
+ setState(() {
+ currentlySelectedValue = roleName;
+ });
+ widget.updateUI(
+ currentlySelectedValue, null);
+ context
+ .read()
+ .recipientSelectorValue =
+ context
+ .read()
+ .roles
+ .firstWhere((element) =>
+ element.name == roleName);
+ Navigator.pop(context);
+ },
+ title: HMSTitleText(
+ text: roleName,
+ textColor: HMSThemeColors
+ .onSurfaceHighEmphasis,
+ fontSize: 14,
+ letterSpacing: 0.1,
+ lineHeight: 20,
+ ),
+ trailing:
+ currentlySelectedValue == roleName
+ ? SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/tick.svg",
+ fit: BoxFit.scaleDown,
+ height: 20,
+ width: 20,
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors
+ .onSurfaceHighEmphasis,
+ BlendMode.srcIn),
+ )
+ : const SizedBox(),
+ ))
+ .toList(),
+ ),
+ ),
+
+ if (HMSRoomLayout.chatData?.rolesWhitelist.isNotEmpty ??
+ false)
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 6.0),
+ child: Divider(
+ height: 1,
+ color: HMSThemeColors.borderBright,
+ ),
+ ),
+
+ ///Participant based selection
+
+ if (HMSRoomLayout.chatData?.isPrivateChatEnabled ??
+ false)
+ Selector, int>>(
+ selector: (_, meetingStore) => Tuple2(
+ meetingStore.peers,
+ meetingStore.peers.length),
+ builder: (_, data, __) {
+ return data.item2 <= 1
+ ? const SizedBox()
+ : Padding(
+ padding: const EdgeInsets.only(
+ left: 24.0, right: 24),
+ child: ListTile(
+ dense: true,
+ horizontalTitleGap: 0,
+ contentPadding: EdgeInsets.zero,
+ titleAlignment:
+ ListTileTitleAlignment.center,
+ leading: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/person.svg",
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors
+ .onSurfaceMediumEmphasis,
+ BlendMode.srcIn),
+ width: 20,
+ height: 20,
+ ),
+ title: HMSTitleText(
+ text: "DIRECT MESSAGE",
+ textColor: HMSThemeColors
+ .onSurfaceMediumEmphasis,
+ fontSize: 10,
+ letterSpacing: 1.5,
+ lineHeight: 16,
+ ),
+ ),
+ );
+ }),
+
+ if (HMSRoomLayout.chatData?.isPrivateChatEnabled ??
+ false)
+ Selector, int>>(
+ selector: (_, meetingStore) => Tuple2(
+ meetingStore.peers,
+ meetingStore.peers.length),
+ builder: (_, data, __) {
+ return data.item2 <= 1
+ ? const SizedBox()
+ : Padding(
+ padding: const EdgeInsets.only(
+ left: 10.0, right: 10),
+ child: Column(
+ children: data.item1
+ .where((peer) =>
+ peer.isLocal == false)
+ .map((peer) => ListTile(
+ onTap: () {
+ setState(() {
+ currentlySelectedValue =
+ peer.name;
+ });
+ widget.updateUI(peer.name,
+ peer.peerId);
+ context
+ .read()
+ .recipientSelectorValue =
+ data.item1.firstWhere(
+ (element) =>
+ element
+ .peerId ==
+ peer.peerId);
+ Navigator.pop(context);
+ },
+ title: HMSTitleText(
+ text: peer.name,
+ textColor: HMSThemeColors
+ .onSurfaceHighEmphasis,
+ fontSize: 14,
+ letterSpacing: 0.1,
+ lineHeight: 20,
+ ),
+ trailing:
+ currentlySelectedValue ==
+ peer.peerId
+ ? SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/tick.svg",
+ fit: BoxFit
+ .scaleDown,
+ height: 20,
+ width: 20,
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors
+ .onSurfaceHighEmphasis,
+ BlendMode
+ .srcIn),
+ )
+ : const SizedBox(),
+ ))
+ .toList(),
+ ),
+ );
+ }),
+ ],
+ ),
+ ),
+ )
+ ],
+ ),
+ );
+ });
+ }
+}
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 d4b1e6b11..065f99743 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
@@ -7,14 +7,15 @@ import 'package:hms_room_kit/src/layout_api/hms_theme_colors.dart';
///This renders the cross button
class HMSCrossButton extends StatelessWidget {
final Function? onPressed;
- const HMSCrossButton({super.key, this.onPressed});
+ final Color? iconColor;
+ const HMSCrossButton({super.key, this.onPressed, this.iconColor});
@override
Widget build(BuildContext context) {
return IconButton(
icon: Icon(
Icons.close,
- color: HMSThemeColors.onSurfaceHighEmphasis,
+ color: iconColor ?? HMSThemeColors.onSurfaceHighEmphasis,
size: 24,
),
onPressed: () {
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 0ca87d07e..77e310f81 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
@@ -15,6 +15,7 @@ import 'package:hms_room_kit/src/widgets/common_widgets/hms_subtitle_text.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
+///[MessageContainer] is a widget that is used to render the message container
class MessageContainer extends StatelessWidget {
final HMSMessage message;
final DateFormat formatter = DateFormat('hh:mm a');
@@ -28,10 +29,14 @@ class MessageContainer extends StatelessWidget {
if (hmsMessageRecipient == null) return "";
if ((hmsMessageRecipient.recipientPeer != null) &&
(hmsMessageRecipient.recipientRoles == null)) {
- return "PRIVATE";
+ if (hmsMessageRecipient.recipientPeer is HMSLocalPeer) {
+ return "to You (DM)";
+ } else {
+ return "to ${hmsMessageRecipient.recipientPeer?.name} (DM)";
+ }
} else if ((hmsMessageRecipient.recipientPeer == null) &&
(hmsMessageRecipient.recipientRoles != null)) {
- return hmsMessageRecipient.recipientRoles![0].name;
+ return "to ${hmsMessageRecipient.recipientRoles?.first.name} (Group)";
}
return "";
}
@@ -40,97 +45,118 @@ class MessageContainer extends StatelessWidget {
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ padding: const EdgeInsets.only(bottom: 8.0),
+ child: Container(
+ decoration: BoxDecoration(
+ color: sender(message.hmsMessageRecipient) != ""
+ ? HMSThemeColors.surfaceDefault
+ : HMSThemeColors.surfaceDim,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
children: [
Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- constraints: BoxConstraints(
- maxWidth: sender(message.hmsMessageRecipient) == ""
- ? width * 0.25
- : width * 0.5),
- child: HMSTitleText(
- text: message.sender?.name ?? "Anonymous",
- fontSize: 14,
- letterSpacing: 0.1,
- lineHeight: 20,
- textColor: HMSThemeColors.onSurfaceHighEmphasis,
- ),
- ),
- const SizedBox(
- width: 4,
- ),
- HMSSubtitleText(
- text: formatter.format(message.time),
- textColor: HMSThemeColors.onSurfaceMediumEmphasis,
+ Row(
+ children: [
+ Container(
+ constraints: BoxConstraints(
+ maxWidth: sender(message.hmsMessageRecipient) == ""
+ ? width * 0.25
+ : width * 0.5),
+ child: HMSTitleText(
+ text: message.sender?.name ?? "Anonymous",
+ fontSize: 14,
+ letterSpacing: 0.1,
+ lineHeight: 20,
+ textColor: HMSThemeColors.onSurfaceHighEmphasis,
+ ),
+ ),
+ const SizedBox(
+ width: 4,
+ ),
+ Container(
+ constraints: BoxConstraints(maxWidth: width * 0.5),
+ child: HMSSubtitleText(
+ text: sender(message.hmsMessageRecipient),
+ textColor: HMSThemeColors.onSurfaceMediumEmphasis),
+ ),
+ ],
),
- ],
- ),
- Row(
- children: [
- GestureDetector(
- onTap: () {
- showModalBottomSheet(
- isScrollControlled: true,
- backgroundColor: HMSThemeColors.surfaceDim,
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(16),
- topRight: Radius.circular(16)),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ HMSSubtitleText(
+ text: formatter.format(message.time),
+ textColor: HMSThemeColors.onSurfaceMediumEmphasis,
+ ),
+ const SizedBox(
+ width: 8,
+ ),
+ GestureDetector(
+ onTap: () {
+ showModalBottomSheet(
+ isScrollControlled: true,
+ backgroundColor: HMSThemeColors.surfaceDim,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(16),
+ topRight: Radius.circular(16)),
+ ),
+ context: context,
+ builder: (ctx) => ChangeNotifierProvider.value(
+ value: context.read(),
+ child: ChatUtilitiesBottomSheet(
+ message: message,
+ )),
+ );
+ },
+ child: SvgPicture.asset(
+ "packages/hms_room_kit/lib/src/assets/icons/more.svg",
+ height: 20,
+ width: 20,
+ colorFilter: ColorFilter.mode(
+ HMSThemeColors.onSurfaceMediumEmphasis,
+ BlendMode.srcIn),
),
- context: context,
- builder: (ctx) => ChangeNotifierProvider.value(
- value: context.read(),
- child: ChatUtilitiesBottomSheet(
- message: message,
- )),
- );
- },
- child: SvgPicture.asset(
- "packages/hms_room_kit/lib/src/assets/icons/more.svg",
- height: 20,
- width: 20,
- colorFilter: ColorFilter.mode(
- HMSThemeColors.onSurfaceMediumEmphasis,
- BlendMode.srcIn),
- ),
+ ),
+ ],
),
],
- )
+ ),
+ const SizedBox(
+ height: 8,
+ ),
+ SelectableLinkify(
+ text: message.message.trim().toString(),
+ onOpen: (link) async {
+ Uri url = Uri.parse(link.url);
+ if (await canLaunchUrl(url)) {
+ await launchUrl(url, mode: LaunchMode.externalApplication);
+ }
+ },
+ options: const LinkifyOptions(humanize: false),
+ style: HMSTextStyle.setTextStyle(
+ fontSize: 14.0,
+ color: HMSThemeColors.onSurfaceHighEmphasis,
+ height: 20 / 14,
+ letterSpacing: 0.25,
+ fontWeight: FontWeight.w400),
+ linkStyle: HMSTextStyle.setTextStyle(
+ fontSize: 14.0,
+ color: HMSThemeColors.primaryDefault,
+ letterSpacing: 0.25,
+ height: 20 / 14,
+ fontWeight: FontWeight.w400),
+ ),
],
),
- const SizedBox(
- height: 8,
- ),
- SelectableLinkify(
- text: message.message.trim().toString(),
- onOpen: (link) async {
- Uri url = Uri.parse(link.url);
- if (await canLaunchUrl(url)) {
- await launchUrl(url, mode: LaunchMode.externalApplication);
- }
- },
- options: const LinkifyOptions(humanize: false),
- style: HMSTextStyle.setTextStyle(
- fontSize: 14.0,
- color: HMSThemeColors.onSurfaceHighEmphasis,
- height: 20 / 14,
- letterSpacing: 0.25,
- fontWeight: FontWeight.w400),
- linkStyle: HMSTextStyle.setTextStyle(
- fontSize: 14.0,
- color: HMSThemeColors.primaryDefault,
- letterSpacing: 0.25,
- height: 20 / 14,
- fontWeight: FontWeight.w400),
- ),
- ],
+ ),
),
);
}
diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock
index cb0c5b7b7..098334077 100644
--- a/packages/hmssdk_flutter/example/pubspec.lock
+++ b/packages/hmssdk_flutter/example/pubspec.lock
@@ -69,10 +69,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:
@@ -362,10 +362,10 @@ packages:
dependency: transitive
description:
name: meta
- sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
+ sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
- version: "1.9.1"
+ version: "1.10.0"
mime:
dependency: transitive
description:
@@ -647,18 +647,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:
@@ -679,10 +679,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:
@@ -839,10 +839,10 @@ packages:
dependency: transitive
description:
name: web
- sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
+ sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
- version: "0.1.4-beta"
+ version: "0.3.0"
win32:
dependency: transitive
description:
@@ -868,5 +868,5 @@ packages:
source: hosted
version: "6.3.0"
sdks:
- dart: ">=3.1.0 <4.0.0"
+ dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.13.0"
diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock
index c3cc2c33e..53939cd59 100644
--- a/packages/hmssdk_flutter/pubspec.lock
+++ b/packages/hmssdk_flutter/pubspec.lock
@@ -37,10 +37,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"
fake_async:
dependency: transitive
description:
@@ -79,10 +79,10 @@ packages:
dependency: transitive
description:
name: meta
- sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
+ sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
- version: "1.9.1"
+ version: "1.10.0"
path:
dependency: transitive
description:
@@ -108,18 +108,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:
@@ -140,10 +140,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"
vector_math:
dependency: transitive
description:
@@ -156,10 +156,10 @@ packages:
dependency: transitive
description:
name: web
- sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
+ sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
- version: "0.1.4-beta"
+ version: "0.3.0"
sdks:
- dart: ">=3.1.0-185.0.dev <4.0.0"
+ dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=2.10.0"