audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

feat: ✨ Smooth recorder waveform with frame-interpolated scroll

Open lavigarg-simform opened this issue 5 months ago • 0 comments

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 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.
  • [x] No, this PR is not a breaking change.

Related Issues

Closes #382

lavigarg-simform avatar Jun 30 '26 08:06 lavigarg-simform