Skip to content

BLoC design pattern #2374

@iluwatar

Description

@iluwatar

Description

The BloC (Business Logic Component) design pattern helps separate business logic from UI components, making applications more modular, testable, and maintainable. This pattern is widely used in Flutter development and involves three main components: Event, State, and Bloc. Events are dispatched by the UI, which are processed by the Bloc to produce new States that the UI listens to and reacts accordingly.

The key elements of the BloC pattern are:

  1. Event: Represents the actions taken by the user or system.
  2. State: Represents the state of the UI at any point in time.
  3. Bloc: Handles the business logic, receives events, processes them, and emits new states.

References

Acceptance Criteria

  1. Implement a basic BloC pattern structure including Event, State, and Bloc classes.
  2. Provide a simple example demonstrating the pattern in action.
  3. Ensure the implementation follows the project contribution guidelines outlined here.

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions