Skip to content

feat: add voice message duration display to VoiceMessageView#427

Merged
vatsaltanna-simformsolutions merged 5 commits into
mainfrom
copilot/fix-voice-message-duration
Jun 10, 2026
Merged

feat: add voice message duration display to VoiceMessageView#427
vatsaltanna-simformsolutions merged 5 commits into
mainfrom
copilot/fix-voice-message-duration

Conversation

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

Description

Voice messages support voiceMessageDuration parameter in the Message model but the duration wasn't rendered in the VoiceMessageView widget. Duration was only visible in reply message previews.

Changes:

  • VoiceMessageView widget: Added conditional Text widget to display voiceMessageDuration after the waveform using the existing toHHMMSS() extension
  • VoiceMessageConfiguration: Added optional durationTextStyle parameter for styling customization (defaults to 12px white text)
  • Documentation: Added usage examples in doc/documentation.md

Usage:

Message(
  id: '1',
  message: '/path/to/audio.m4a',
  createdAt: DateTime.now(),
  sentBy: userId,
  messageType: MessageType.voice,
  voiceMessageDuration: Duration(seconds: 15), // Now displays in bubble
)

Customize appearance via configuration:

VoiceMessageConfiguration(
  durationTextStyle: TextStyle(fontSize: 12, color: Colors.white),
)

Visual Representations:

Before After
Before Screenshot After Screenshot

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.
Original prompt

This section details on the original issue you should resolve

<issue_title>issue in voice messge duration</issue_title>
<issue_description>
how can I display the voice message duration , I already passed the duration into the message model
Message(
id: id?.toString() ?? '',
message: chatViewMessageType == MessageType.text
? (message ?? '')
: (file ?? ''),
createdAt: parsedDate ?? DateTime.now(),
sentBy: sender?.id?.toString() ?? '',
messageType: chatViewMessageType,
voiceMessageDuration:Duration(seconds: 15) // test

and when voice is displayed there is no duration appears
is there any step missed??
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix issue in voice message duration display feat: add voice message duration display to VoiceMessageView Jan 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds visible duration display for voice messages in the main chat bubble, leveraging the existing voiceMessageDuration field and the toHHMMSS() extension, and exposes configuration to style that duration text along with documentation updates.

Changes:

  • Update VoiceMessageView to render voiceMessageDuration next to the waveform when present, formatted via toHHMMSS().
  • Extend VoiceMessageConfiguration with an optional durationTextStyle to customize the duration label appearance.
  • Document voice message duration usage and styling in doc/documentation.md, including examples for message creation and configuration.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/src/widgets/voice_message_view.dart Renders the voice message duration text conditionally after the waveform, using VoiceMessageConfiguration.durationTextStyle with a sensible default.
lib/src/models/config_models/voice_message_configuration.dart Adds the new durationTextStyle field to the configuration model and documents its purpose.
doc/documentation.md Adds a new “Voice Message Duration” section and updates the voice message configuration example to show how to style the duration label.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vasu-nageshri vasu-nageshri marked this pull request as ready for review May 11, 2026 05:20
Copilot AI and others added 4 commits June 8, 2026 14:31
Co-authored-by: vatsaltanna-simformsolutions <63704011+vatsaltanna-simformsolutions@users.noreply.github.com>
Co-authored-by: vatsaltanna-simformsolutions <63704011+vatsaltanna-simformsolutions@users.noreply.github.com>
@vasu-nageshri vasu-nageshri force-pushed the copilot/fix-voice-message-duration branch 4 times, most recently from 99decd1 to 4d327eb Compare June 9, 2026 08:39
Comment thread CHANGELOG.md Outdated
@vasu-nageshri vasu-nageshri force-pushed the copilot/fix-voice-message-duration branch from 4d327eb to 5ce03b4 Compare June 9, 2026 10:14
@vasu-nageshri vasu-nageshri force-pushed the copilot/fix-voice-message-duration branch from 5ce03b4 to c9e29f9 Compare June 9, 2026 10:16
@vatsaltanna-simformsolutions vatsaltanna-simformsolutions merged commit 7e8e2a8 into main Jun 10, 2026
1 check passed
@vatsaltanna-simformsolutions vatsaltanna-simformsolutions deleted the copilot/fix-voice-message-duration branch June 10, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue in voice messge duration

5 participants