togglePlayPause method
Implementation
Future<void> togglePlayPause() async {
final isPlaying = await _key.currentState?.isPlaying();
if (isPlaying == true) {
await pause();
} else {
await play();
}
}
Future<void> togglePlayPause() async {
final isPlaying = await _key.currentState?.isPlaying();
if (isPlaying == true) {
await pause();
} else {
await play();
}
}