feat: ✨ Add WaveStyle.maxDuration for proportional recording width#503
Open
lavigarg-simform wants to merge 1 commit into
Open
feat: ✨ Add WaveStyle.maxDuration for proportional recording width#503lavigarg-simform wants to merge 1 commit into
lavigarg-simform wants to merge 1 commit into
Conversation
5caa97b to
de26b68
Compare
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
de26b68 to
8d3f102
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
WaveStyle.maxDurationso 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
WaveStyle.maxDuration.elapsedRecordingDuration / maxDurationof the available width.maxDurationof 10s, stopping at 5s draws across half the width; reaching 10s fills the full width; recording past 10s stays clamped to the full width.extendWaveform) and takes precedence overextendWaveformwhen both are set.null, which keeps the existing scrolling behavior unchanged.UI Changes
When
maxDurationis 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 whenmaxDurationis unset.Before (without
maxDuration)Screen.Recording.2026-06-29.at.7.44.27.PM.mov
After (optional
maxDurationset to 10s)Screen.Recording.2026-06-29.at.7.43.21.PM.mov
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Closes #91