flutter_voice_recorder_ui 0.2.2
flutter_voice_recorder_ui: ^0.2.2 copied to clipboard
A WhatsApp-style hold-to-record voice button with live waveform animation. Outputs raw PCM bytes for streaming to voice-AI APIs (OpenAI, Gemini, Whisper).
Changelog #
0.2.2 — Fix lower-bound constraint on record #
- Tighten
recordconstraint from^6.1.2to^6.2.0. TheAudioRecorder.hasPermission(request: ...)parameter used byVoiceRecorderController.requestPermission()was added in 6.2.0, so the previous lower bound caused a downgrade-analysis failure on pub.dev ("Compatible with dependency constraint lower bounds", 0/20 points). Score should return to 160/160.
0.2.1 — Bump dependencies for full pub.dev score #
- Updated
permission_handlerconstraint to^12.0.1(was^11.3.1). Picks up the latest mic-permission flow improvements. - Updated
flutter_lintsto^6.0.0. - Removed unnecessary
librarydirective in the package's main export file. - No API or behavior changes.
0.2.0 — WhatsApp parity & general-purpose defaults #
Default behavior changes (existing apps may see different visuals):
- Recording now requires a ~120 ms long-press; a quick tap is discarded. This stops accidental presses from triggering the mic permission prompt.
- Default
micColoris nowTheme.colorScheme.primary(was WhatsApp green). PassmicColor: Color(0xFF25D366)explicitly for the WhatsApp look. - Default
timerColorfollowsTheme.colorScheme.onSurface.
WhatsApp-style interaction polish:
- Lock rail grows like an elevator as the user slides up — the pill stretches from its base height while staying anchored to the current mic position. The chevron at the bottom fades as you approach lock engage.
- Mic button follows your finger in both axes (was horizontal-only). The lock rail's bottom tracks the rising mic so they stay visually connected.
- Recording pill stays put during slide-to-cancel — the mic slides over it, occluding "Slide to cancel" progressively (matches real WhatsApp; was translating both together).
- Rubber-band resistance past the cancel threshold — the mic keeps tracking the finger at 30% resistance instead of clamping at a hard cap.
Snappier feel:
- Pill expand: 240 → 150 ms.
- Mic press scale: 180 → 120 ms (curve changed to
easeOutCubic— clean snap, no overshoot). - Lock rail height tracks the finger pixel-perfect every frame
(previously used an 80 ms
AnimatedContainertween — visibly laggy). - Subtle press visual during the 120 ms hold-detection window so the press is acknowledged even before recording starts.
New API:
VoiceRecorderButton.recordingIndicatorColor— color of the small pulsing mic icon inside the recording pill (defaults to a universal red#EF4444).LockedRecordingBar.waveformColor— dotted waveform color in locked mode.LockedRecordingBar.sendButtonColor— circular send button color.LockRail.extension— vertical drag distance, drives the growing-elevator effect.
Bug fixes:
- Release now reliably stops the recording even when the user releases
before the mic permission prompt finishes (was leaving the timer running
forever because
bytesStreamthrew on early access). - Widget height no longer shrinks 96 px when crossing into the cancel zone (was causing a layout jump that felt like the gesture got "stuck").
- Lock pill chevron no longer overflows its container (base height 60 → 76 so two 22-px icons fit).
- UI resets instantly on release; the slow native
MediaRecorder.cancel()now runs in the background instead of blocking the visible reset. - Idle mic icon is now
Icons.mic_none(outlined), recording uses filledIcons.mic, with a snappy scale-swap transition.
0.1.1 — WhatsApp UI polish #
- Recording pill now matches WhatsApp: pulsing pink mic + timer + slide-to-cancel (waveform moved out — it only appears in locked mode, where it belongs)
- Taller, more prominent lock rail (40×~90) with a gently bouncing up-chevron
- Locked recording bar uses real circular
InkWellhit targets and an animated pause/play swap - Idle button now correctly shows
Icons.mic_none(outlined) and switches to filledIcons.micwhen recording LockedRecordingBargainswaveformColorandsendButtonColorparametersDottedWaveformscrolls newest-on-right like the live waveform, with amplitude-driven dot size variation- Snappier overall: pill expand 300 → 240 ms, mic press 150 → 130 ms
0.1.0 — Initial release #
- Hold-to-record
VoiceRecorderButtonwidget - Live amplitude-driven waveform animation
- Slide-to-cancel gesture
- Streaming raw PCM byte output via
bytesStream - Configurable sample rate, channels, encoder
- Built-in mic permission handling
VoiceRecorderControllerfor headless / custom-UI use