Flutter error: the getter 'AudioPlayerState' isn't defined for the class '_HomePageState'
1,144
if (event == PlayerState.PLAYING) {
Author by
vaibhav bhapkar
Updated on December 29, 2022Comments
-
vaibhav bhapkar over 1 year
I have imported audioplayer.dart but it is still showing me the error: the getter 'AudioPlayerState' isn't defined for the class '_HomePageState'
import 'package:audioplayers/audioplayers.dart'; _audioPlayer.onPlayerStateChanged.listen((event) { if (event == AudioPlayerState.PLAYING) { _isPlaying = true; } else { _isPlaying = false; } setState(() {}); });
-
Nisanth Reddy almost 3 yearsHi There. This is not the code that is causing the issue. Post your full code.
-