I am trying to develop a cross-platform application that plays audio for theatrical purposes and I can play the audio, but I cannot stop it. My code in my AudioPlayback (audio_playback.dart) object is below for stopping the AudioPlayer from just_audio:
Future<void> stopAudio() async {
debugPrint("Stopping audio playback");
await player.stop();
}
I am calling stop from a different widget than the main body widget, but I do not think that should be an issue.
Here is the link to my stop button code: https://github.com/bgoldstone/cue_go/blob/main/lib/cue_widgets/playback_bar.dart
The stop functionality starts on line 123 and this is a playback bar within the application.
I tried wrapping the stop in the cue_list.dart setState function and using async await and then

It's looks like you mess something with callback
When you tap on
IconButtonand callbackonPressedworked, in these lines:you just throw a function at the top with this code:
but you don't call this piece of code:
try this: