Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BLoC - An architecture based on Stream!

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

BLoC - An architecture based on Stream!

Basics of BLoC

Avatar for Devarsh Ranpara

Devarsh Ranpara

March 19, 2021

More Decks by Devarsh Ranpara

Other Decks in Programming

Transcript

  1. Let’s revise the State Management - What’s the problem with

    setState? - Why we need of MobX (Or any other architecture)?
  2. What is an architecture? - Structure which defines relation between

    components. - Blueprint which will be followed by everyone in the team.
  3. Why we need an architecture? - Mo make a software

    scalable - To maintain a standards - To make code more testable - To be on same page with all team members
  4. What is BLoC? - Business Logic Components. - It’s library

    to separate business logic from components and make code maintainable.
  5. Why we should use BLoC? - Makes code scalable -

    Multiple developers can work on same code base with same pattern - Makes code more testable
  6. Components of BLoC - BlocProvider - BlocBuilder - BlocListner -

    BlocConsumer - MultiProvider - MultiBlocListener
  7. BlocBuilder - We can compare it with Observer of MobX.

    - It rebuilds UI when state of BloC or Cubit updates
  8. BLoC vs MobX - Works on Stream - Need to

    write code and handle everything . - Bit complex to understand - It has every components for almost every use case - It has wide adaptation and heavily used. - Works on Observables - Code generator helps to reduce boilerplate code - Easy to understand - It has only three components for managing UI. - MobX is emerging