Allow participants to raise their hand to get attention during calls. This feature is useful for large meetings, webinars, or any scenario where participants need to signal they want to speak.
Raise Hand
Signal that you want to speak or get attention:
await CallSession.getInstance()?.raiseHand();
Lower Hand
Remove the raised hand indicator:
await CallSession.getInstance()?.lowerHand();
Listen for Raise Hand Events
Monitor when participants raise or lower their hands using ParticipantEventListener:
CallSession? callSession = CallSession.getInstance();
callSession?.addParticipantEventListener(ParticipantEventListener(
onParticipantHandRaised: (Participant participant) {
debugPrint("${participant.name} raised their hand");
// Show notification or visual indicator
showHandRaisedNotification(participant);
},
onParticipantHandLowered: (Participant participant) {
debugPrint("${participant.name} lowered their hand");
// Remove notification or visual indicator
hideHandRaisedIndicator(participant);
},
// Other callbacks...
onParticipantJoined: (Participant participant) {},
onParticipantLeft: (Participant participant) {},
onParticipantListChanged: (List<Participant> participants) {},
onParticipantAudioMuted: (Participant participant) {},
onParticipantAudioUnmuted: (Participant participant) {},
onParticipantVideoPaused: (Participant participant) {},
onParticipantVideoResumed: (Participant participant) {},
onParticipantStartedScreenShare: (Participant participant) {},
onParticipantStoppedScreenShare: (Participant participant) {},
onParticipantStartedRecording: (Participant participant) {},
onParticipantStoppedRecording: (Participant participant) {},
onDominantSpeakerChanged: (Participant participant) {},
));
Flutter listeners are not lifecycle-aware. You must manually remove listeners in your widget’s dispose() method to prevent memory leaks.
Check Raised Hand Status
The Participant object includes a raisedHandTimestamp property to check if a participant has their hand raised:
CallSession? callSession = CallSession.getInstance();
callSession?.addParticipantEventListener(ParticipantEventListener(
onParticipantListChanged: (List<Participant> participants) {
final raisedHands = participants
.where((p) => p.raisedHandTimestamp > 0)
.toList()
..sort((a, b) => a.raisedHandTimestamp.compareTo(b.raisedHandTimestamp));
// Display participants with raised hands in order
updateRaisedHandsList(raisedHands);
},
));
To disable the raise hand feature, hide the button in the call UI:
SessionSettings sessionSettings = CometChatCalls.SessionSettingsBuilder()
.hideRaiseHandButton(true)
.build();