0

how can i implement multiple blocs inside single screen.for instance take example of INSTAGRAM home page,there we can see

  1. Feed
  2. Stories
  3. messages count

how can i implement in single page listen for changes in each state ?. should i implement bloc for each feature (then how to handle multiple bloc for each page ) or bloc for each page (home,settings) ?.

i believe bloc for each feature can reuse bloc for different pages (profile,explore),does it complicate things ?

Anoop
  • 66
  • 1
  • 7

1 Answers1

1

This is how I solved communication of different blocs on a single page. My intent was also to reuse a bloc on multiple pages for the same data and to use a seperate bloc for other functionality on each page. Especially if you go back and forth, a single bloc for a feature across pages should simplify things.

w461
  • 2,168
  • 4
  • 14
  • 40
  • how can i listen to multiple bloc events or bloc state on a single page ?. Lets say i have two feature in single page and each feature has its own bloc, how can i listen to both blocs – Anoop Oct 10 '20 at 15:26
  • Just follow the link above. There is a Multi bloc provider and for each feature you would use one bloc builder, so put Rothe feature within the brackets of the builder. If this helps, please feel free to give it an up vote – w461 Oct 11 '20 at 07:31