I am quite new to flutter and even newer to Bloc pattern. I am building a music player app to get a better grasp of the basic concepts of bloc. What I want to know is that should we actually use navigation with Bloc patter or simply display everything on the same page.

Eg: I have a page with a grid view of playlists and the playlists name and album art and stuff are supplied by a bloc(playlist_provider_bloc). I also have a separate bloc for providing the songs list(song_provider_bloc) and stream url and stuff in another bloc. Now here are a few ways I have thought about:

  1. Simply creating a separate instance of song_provider_bloc for every playlist and pass that instance when pushing the page for displaying songs.

  2. Use a single instance of song_provider_bloc and keeping the name of the playlist in the song_provider_state so as to check if the currently open playlist is changed.

  3. Do not use navigation. Just update a single page for both playlist and song list.

So which approach is the best one among the following?

0 Answers