Skip to content

feat: ✨ Add WaveStyle.maxDuration for proportional recording width#503

Open
lavigarg-simform wants to merge 1 commit into
mainfrom
fix/I091_proportional-record-width
Open

feat: ✨ Add WaveStyle.maxDuration for proportional recording width#503
lavigarg-simform wants to merge 1 commit into
mainfrom
fix/I091_proportional-record-width

Conversation

@lavigarg-simform

@lavigarg-simform lavigarg-simform commented Jun 29, 2026

Copy link
Copy Markdown

Description

Adds WaveStyle.maxDuration so the recording waveform can be bound to a fixed maximum duration instead of scrolling.

Today the recording waveform grows until it hits the middle of the width and then scrolls left, so every recording ends up looking the same length no matter how long it actually was. There was no way to make the drawn length reflect the recording length.

What changed

  • New optional WaveStyle.maxDuration.
  • When set, the waveform no longer scrolls. It fills only elapsedRecordingDuration / maxDuration of the available width.
  • Example: with maxDuration of 10s, stopping at 5s draws across half the width; reaching 10s fills the full width; recording past 10s stays clamped to the full width.
  • LTR only (ignored for RTL, like extendWaveform) and takes precedence over extendWaveform when both are set.
  • Fully backward compatible: default is null, which keeps the existing scrolling behavior unchanged.

UI Changes

When maxDuration is set, the recording waveform stays inside the box and its length now reflects how far the recording is toward the cap, instead of growing and scrolling. No change when maxDuration is unset.

Before (without maxDuration)

Screen.Recording.2026-06-29.at.7.44.27.PM.mov

After (optional maxDuration set to 10s)

Screen.Recording.2026-06-29.at.7.43.21.PM.mov

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.

Related Issues

Closes #91

@lavigarg-simform lavigarg-simform force-pushed the fix/I091_proportional-record-width branch from 5caa97b to de26b68 Compare June 29, 2026 14:38
Bounds the recording waveform to a max duration instead of scrolling: the
wave fills elapsed/maxDuration of the available width (full at maxDuration,
clamped beyond). LTR-only; takes precedence over extendWaveform. Non-breaking
— null keeps the existing scroll behavior.

Closes #91
@lavigarg-simform lavigarg-simform force-pushed the fix/I091_proportional-record-width branch from de26b68 to 8d3f102 Compare June 29, 2026 14:40
@lavigarg-simform lavigarg-simform marked this pull request as ready for review June 29, 2026 14:43
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.

Can fix wave max length width when Record?

1 participant