feat: enhance voice call functionality and response handling

- Introduced a new boolean flag `_isSpeaking` in VoiceCallService to manage speaking state during voice interactions.
- Improved response handling by extracting incremental content from socket events and updating the accumulated response accordingly.
- Updated the chat page to include a voice call button, allowing users to initiate voice calls directly from the chat interface.
- Enhanced the modern chat input widget to support voice call functionality, providing a seamless user experience for initiating calls.
This commit is contained in:
cogwheel0
2025-10-08 19:09:57 +05:30
parent 7dd41ebf60
commit ea79a193be
3 changed files with 138 additions and 45 deletions

View File

@@ -1445,16 +1445,6 @@ class _ChatPageState extends ConsumerState<ChatPage> {
),
actions: [
if (!_isSelectionMode) ...[
// Voice call button
IconButton(
icon: Icon(
CupertinoIcons.phone,
color: context.conduitTheme.textPrimary,
size: IconSize.appBar,
),
onPressed: _handleVoiceCall,
tooltip: 'Voice Call',
),
Padding(
padding: const EdgeInsets.only(right: Spacing.inputPadding),
child: IconButton(
@@ -1566,6 +1556,7 @@ class _ChatPageState extends ConsumerState<ChatPage> {
onSendMessage: (text) =>
_handleMessageSend(text, selectedModel),
onVoiceInput: null,
onVoiceCall: _handleVoiceCall,
onFileAttachment: _handleFileAttachment,
onImageAttachment: _handleImageAttachment,
onCameraCapture: () =>