[HELP]:
See original GitHub issueI need Help for :
- Using the API ?
Here is my question :
I have this part of the code where I expect the stop icon to change to play icon when the player finished playing the file.
IconButton(
onPressed: () async {
if (_isPlaying) {
_isPlaying = false;
setState(() {});
await audioPlayer.stopPlaying();
} else {
_isPlaying = true;
_fileNamePlaying = entry.fileName;
setState(() {});
await audioPlayer
.play(entry.fileName);
_isPlaying = false;
setState(() {});
}
},
icon: Icon(
_isPlaying &&
_fileNamePlaying ==
entry.fileName
? Icons.stop
: Icons.arrow_right,
size: 30)),
For some reason await audioPlayer.play(entry.fileName); doesn’t wait and executes the rest of the code thus the play icon changes to to stop and play immediately. I need the setState to run after the file is finished playing… I appreciate if someone could help. Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:29
Top Results From Across the Web
Help Definition & Meaning - Merriam-Webster
verb ; a · to be of use to : benefit. will do anything to help their cause ; b · to further...
Read more >The Beatles - Help! - YouTube
Music video by The Beatles performing Help !. © 2015 Calderstone Productions Limited (a division of Universal Music Group) / Subafilms ...
Read more >HELP | definition in the Cambridge English Dictionary
help meaning: 1. to make it possible or easier for someone to do something, by doing part of the work yourself or…. Learn...
Read more >Help Definition & Meaning | Dictionary.com
to make easier or less difficult; contribute to; facilitate: The exercise of restraint is certain to help the achievement of peace.
Read more >Help! - Wikipedia
Help ! is the fifth studio album by the English rock band the Beatles and the soundtrack to their film of the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
😄
Just click on the “likes” button on top of pub.dev.
I am really happy when people are pleased by my work. Take care.
Now that worked… I’d really suggest adding this parameter type info to the docs as well. Or on android studio when hovered over the method… It’s very confusing. Now how can i buy you a beer mate ? Donate to the project ?