Flutter Application from nothing to production. Part 1
Labor makes a tired asshole out of monkey
It’s my favorite version of the phrase about a monkey and labor. Do you feel tired? Do you have any sensations connected with burnout and life end? If yes, then this article either will be a motivational injection or will finish you off. Good luck.
I have never listened to audiobooks before. Also, I didn’t have any opinion about it, but now I can say exactly that it’s a special format for immersion in different stories and texts. And you should definitely try it.
Well, let’s go!
If we talk about applications with audiobooks or music, the first tasks which you need to resolve are these:
- Playing audio
- Managing audio
- Background mode
First, for playing audio you can use a lot of different plugins, but I chose just_audio because this thing works better. It has all the needed events and methods like caching.
Single or playlist playing.
Playing from cache or network etc.
You can adapt and use it right now!
The first two tasks are resolved. How about a background mode? It will be a more interesting task. Each platform like IOS and Android has an internal player. Usually, it’s a background process that can be used by any application if the necessary permissions have been previously obtained. It means that the just_audio player and platform(IOS/Android) player are different and you need to synchronize them.
I am glad to show the audio_service and audio_session plugins. audio_session needs to inform the operating system of the nature of your audio app, for example:
audio_service does more stuff. This plugin wraps around just_audio(you can use another audio plugin) to allow it to run in the background or with the screen turned off. It provides a lot of different possibilities. It’s a big topic and if you want to know more then check this article.
Сonclusion
If we talk about modern audio applications, then just creating a player is not enough. We should store listening history, the current audiobook, position, and a lot of other things. The beautiful picture and comfortable UI are important. But these topics are for the other stories.
What do you want to see next? I can tell you about BLOC architecture, beautiful components, synchronization of data, etc. Welcome to the comments.
You can download and try the application here Apple IOS / Android
Eugene Mahota
Full Stack Developer at First Line Outsourcing
Move your business forward
Web and mobile development that help companies reach their goals.