What is the BLoC pattern in Flutter?
Why Interviewers Ask This
This question targets practical, hands-on experience with Flutter. Interviewers want to see if you've worked with these concepts in real projects, not just read about them. Strong answers include concrete examples.
Answer
The BLoC (Business Logic Component) pattern separates business logic from the UI using streams. The UI dispatches Events to a BLoC, the BLoC processes the event and emits a new State, and the UI rebuilds in response to the new state. The flutter_bloc package makes this concrete with Cubit (simpler, state-based) and Bloc (full event-to-state mapping). BLoC excels in large teams because the business logic is completely decoupled and easily testable.
Common Mistake
Don't just define the term — demonstrate that you understand when to use it and when not to. Showing awareness of trade-offs is what separates average from strong Flutter candidates.