ワンクリックで
custom-ui
// Custom UI for CometChat Calls SDK v5 Flutter. Custom control panel, hide default UI, build your own call controls. Triggers on "custom ui", "custom controls", "hide control panel", "custom layout", "overlay", "custom buttons".
// Custom UI for CometChat Calls SDK v5 Flutter. Custom control panel, hide default UI, build your own call controls. Triggers on "custom ui", "custom controls", "hide control panel", "custom layout", "overlay", "custom buttons".
Set up CometChat Calls SDK v5 for Flutter. Use when adding SDK dependency, configuring CallAppSettings, CometChatCalls.init, platform permissions. Triggers on "setup calls sdk", "add cometchat dependency", "initialize calls", "pubspec".
Audio controls for CometChat Calls SDK v5 Flutter. Mute/unmute audio, switch audio mode (speaker, earpiece, bluetooth). Triggers on "mute", "unmute", "audio", "speaker", "earpiece", "bluetooth", "audio mode".
Background call handling in CometChat Calls SDK v5 Flutter. Keep calls alive in background, OngoingCallService, lifecycle management. Triggers on "background", "foreground service", "keep alive", "app lifecycle", "background call".
Fetch and display call history using CallLogRequest and CallLogRequestBuilder. Use when showing call logs, call history, filtering by type/status/direction. Triggers on "call logs", "call history", "CallLogRequest", "fetchNext", "call records".
CometChat Calls SDK v5 event listeners for Flutter. SessionStatusListeners, ParticipantEventListeners, MediaEventListeners, ButtonClickListeners, LayoutListeners. Triggers on "listener", "event", "callback", "onSessionJoined", "onParticipantJoined", "onAudioModeChanged".
In-call chat messaging during active CometChat call session in Flutter. Chat button, unread count badge. Triggers on "in-call chat", "chat button", "messaging during call", "unread count", "in call message".
| name | custom-ui |
| description | Custom UI for CometChat Calls SDK v5 Flutter. Custom control panel, hide default UI, build your own call controls. Triggers on "custom ui", "custom controls", "hide control panel", "custom layout", "overlay", "custom buttons". |
| inclusion | manual |
Build custom call controls by hiding the default SDK UI and using CallSession methods programmatically. Overlay your own Flutter widgets on top of the call view.
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
final settings = SessionSettingsBuilder()
.hideControlPanel(true) // Hide bottom control bar
.hideHeaderPanel(true) // Hide top header
.build();
class CustomCallScreen extends StatefulWidget {
final String sessionId;
const CustomCallScreen({super.key, required this.sessionId});
@override
State<CustomCallScreen> createState() => _CustomCallScreenState();
}
class _CustomCallScreenState extends State<CustomCallScreen>
implements SessionStatusListeners {
Widget? _callWidget;
bool _isMuted = false;
bool _isVideoOff = false;
@override
void initState() {
super.initState();
_joinSession();
}
void _joinSession() {
final settings = SessionSettingsBuilder()
.hideControlPanel(true)
.hideHeaderPanel(true)
.build();
CometChatCalls.joinSession(
sessionId: widget.sessionId,
sessionSettings: settings,
onSuccess: (Widget? widget) {
setState(() => _callWidget = widget);
CallSession.getInstance()?.addSessionStatusListener(this);
},
onError: (e) => Navigator.pop(context),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
// Call video view
if (_callWidget != null) _callWidget!,
// Custom controls overlay
Positioned(
bottom: 40,
left: 0,
right: 0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// Mute button
FloatingActionButton(
onPressed: _toggleMute,
backgroundColor: _isMuted ? Colors.red : Colors.white,
child: Icon(_isMuted ? Icons.mic_off : Icons.mic),
),
// End call button
FloatingActionButton(
onPressed: _endCall,
backgroundColor: Colors.red,
child: const Icon(Icons.call_end, color: Colors.white),
),
// Video toggle button
FloatingActionButton(
onPressed: _toggleVideo,
backgroundColor: _isVideoOff ? Colors.red : Colors.white,
child: Icon(_isVideoOff ? Icons.videocam_off : Icons.videocam),
),
],
),
),
],
),
);
}
void _toggleMute() async {
final session = CallSession.getInstance();
await session?.toggleMuteAudio();
setState(() => _isMuted = session?.isAudioMuted ?? false);
}
void _toggleVideo() async {
final session = CallSession.getInstance();
await session?.togglePauseVideo();
setState(() => _isVideoOff = session?.isVideoPaused ?? false);
}
void _endCall() async {
await CallSession.getInstance()?.leaveSession();
if (mounted) Navigator.pop(context);
}
@override
void onSessionLeft() {
if (mounted) Navigator.pop(context);
}
@override
void onConnectionClosed() {
if (mounted) Navigator.pop(context);
}
}
// Hide specific buttons while keeping the control panel
final settings = SessionSettingsBuilder()
.hideRaiseHandButton(true)
.hideShareInviteButton(true)
.hideRecordingButton(true)
.hideChangeLayoutButton(true)
.hideChatButton(true)
// Keep these visible:
// hideToggleAudioButton(false)
// hideToggleVideoButton(false)
// hideLeaveSessionButton(false)
.build();
Widget must remain in the widget tree for the call to stay activeStack to overlay custom controls on top of the call widgetCallSession methods work regardless of whether the default UI is visibleonSessionLeft and onConnectionClosed to clean upCallSession statelib/screens/call_screen.dart — Default call screen (can be customized)