Task:- Create a media player.

Functionality :-

  1. Play
  2. Pause
  3. 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.


Stop Audio:-

Pause Audio:-

Decoration:- Use decoration function in the application, it will give good look and feel.

Final output:-

Thank you ………….




Datametica Intern

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium


Bedrocktimize Pack Quick Settings Addon

Bedrocktimize Pack (Quick & Organized Settings + FPS Options)

Outlook Your Profile Is Not Configured

AvoidNullPointerExceptions, Using NullAway from Uber’s “Open Source Tool”

Diving into HashMap in Java

Errors in Programming

Here’s What I Learned in My 10 Years as a Software Developer

What is RESTful API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nikhil S Wani

Nikhil S Wani

Datametica Intern

More from Medium

5 Steps to Create Production Ready Flutter Web App

Tales of a Fantastic Flutter Fantasy

How do I migrate the mobile app from Cordova to Flutter?

Un Desafío De Flutter #1