Task:- Create a media player.
Functionality :-
- Play
- Pause
- Stop
Flutter is a multi-platform, open source, and free framework for creating mobile applications, created by Google. It is very easy to learn and currently it is getting more and more popular.
Dependencies:- Add dependencies in pubspace.yaml file.
After adding dependencies, save the program. It will download dependencies.
Add audio file and image:-
Create folders for audio file, images, and assets,
Add assets:-
Required libraries:-
Add audio player:-
play Audio:- Here, I have created an anonymous lambda function. In the below code, I have added play and pause functionality in the same button. Using the present condition it will take the decision of play and pause using the help of play_flag variable.
AppBar:-
Stop Audio:-
Pause Audio:-
Decoration:- Use decoration function in the application, it will give good look and feel.
Final output:-
Thank you ………….