The new recording state logic clears waveformData and resets the timer when a session is paused, stopped, or discarded, but _VoiceToTextViewState still schedules _waveformTimer in initState and never cancels or gates it based on recordingState. As a result, _pushWaveformSample keeps publishing random samples even after discardRecording() has emptied the waveform or when the state is paused/stopped, so the UI immediately repopulates with a live waveform and the “clear” action has no visible effect. Consider starting the periodic sampler only while RecordingState.recording or checking the state before pushing samples so the waveform can actually freeze or clear when recording is inactive.
The new recording state logic clears waveformData and resets the timer when a session is paused, stopped, or discarded, but _VoiceToTextViewState still schedules _waveformTimer in initState and never cancels or gates it based on recordingState. As a result, _pushWaveformSample keeps publishing random samples even after discardRecording() has emptied the waveform or when the state is paused/stopped, so the UI immediately repopulates with a live waveform and the “clear” action has no visible effect. Consider starting the periodic sampler only while RecordingState.recording or checking the state before pushing samples so the waveform can actually freeze or clear when recording is inactive.