APP1: -BRING MUSIC TO YOU: Music/Video App using Flutter framework.

Himanshu Silswal
3 min readDec 9, 2020

Task1: Flutter App Dovelopment

  1. create flutter app.
  2. Use function to make it more creative(Use assets *audios and *videos).
  3. It will play the music and videos using these kind of assets.
  4. Its has also the facility to play the music through the internet using Network function.
  5. We have use button for the music player features.

Introduction

Flutter — a simple and high-performance framework based on Dart language, provides high performance by rendering the UI directly in the operating system’s canvas rather than through native framework.

Flutter also offers many ready to use widgets (UI) to create a modern application. These widgets are optimized for mobile environment and designing the application using widgets is as simple as designing HTML.

Now I will show, steps for creating the app:

The flutter SDK doesn’t have the support for playing audio I searched for the packages in pub.dev (package website for flutter). I found “Assests” package for playing local or network audios.

Step 1: update the pubspec.yaml file with required dependencies. PLEASE CHECK THE FOLLOWING IMAGE:

pubspec.yaml

Step 2: There is a file in lib folder main.dart which will be the entry point of the app. For enabling the hot reload functionality in flutter I have used the Stateless widget.

main.dart

Step 3: Return type of the main.dart file will be material app.

Now for the music player.

I have build the music player that runs the music locally and from the network in the same screen. You can use Tab Functionality that comes with flutter.

For using the asset package first make the assets folder in the directory where the project is saved(like assets folder below the android folder on the left side).

Then after creating the folder, update in the pubspec.yaml file that you are going to use the audio or video from this folder.

In order to play the audio locally we have to make ab object of AssetsAudioPlayer() class.

Then using different functions of AssetsAudioPlayer() class and associating them with different RaisedButtons we can create the different music player buttons for play, pause, stop.

image of working of app.

Now for playing the music online AssetsAudioPlayer() class has audio.Network(‘url’) function defining.

Thankyou for your interest .

--

--

Himanshu Silswal
0 Followers

I am a student persuing the B.tech(CSE) and i am very keen learner of the technology of upgraded framework