audio_waveforms
audio_waveforms copied to clipboard
feat: ✨ Smooth recorder waveform with frame-interpolated scroll
Description
The recorder waveform scrolled in hard, discrete jumps — it shifted one full bar-spacing per new audio sample with nothing drawn between frames. On fast devices (especially Impeller) this looked choppy next to other animated UI.
What changed
- Each pushback now animates the scroll over 80 ms, easing from the current rendered position to the new target instead of snapping.
- The painter keeps two distances: a rendered (animated) one for drawing and a logical (final) one for the overflow check. The check uses the logical target so pushback can't double-fire mid-animation.
- Per-frame repaints during the animation now refresh only the waveform painter, not the whole widget subtree and clipper — keeps the smoothing cheap.
- Clearing the waveform resets all animation state, so no leftover motion carries into the next recording.
RTL recording is unaffected — it advances by index and was already smooth.
No public API change. Internal rendering only.
UI Changes
Recorder waveform scroll is now frame-interpolated instead of stepping in discrete jumps.
Before
https://github.com/user-attachments/assets/f787375d-c179-43b3-b980-60e86c34351b
After
https://github.com/user-attachments/assets/83e342b8-3a16-426f-a942-39832e8fc0ab
Checklist
- [x] The title of my PR starts with a Conventional Commit prefix (
fix:,feat:,docs:etc). - [x] 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
docsand added dartdoc comments with///. - [ ] I have updated/added relevant examples in
examplesordocs.
Breaking Change?
- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.
Related Issues
Closes #382