Skip to content

This is a project that shows how to use the Flutter BLoC pattern. It teaches how to work with events, states, and the BLoC class. Additionally, it demonstrates the use of the BLoC Builder along with BLoC Provider.

Notifications You must be signed in to change notification settings

itsmeAmal/flutter_bloc_pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Certainly! Below is a simple README template for your GitHub project that explains the Flutter BLoC pattern and how to use it in your sample project:


Flutter BLoC Pattern Sample Project

This is a sample Flutter project that illustrates the implementation of the BLoC (Business Logic Component) pattern. The project showcases how to effectively use events, states, and the BLoC class in conjunction with the BLoC Builder and BLoC Provider.

Getting Started

To get started with this project, follow the steps below:

Prerequisites

Make sure you have Flutter installed on your machine. If not, you can follow the installation instructions on the official Flutter website.

Clone the Repository

git clone https://github.com/itsmeAmal/flutter_bloc_pattern.git

Run the Project

flutter run

This will launch the Flutter application on your device or emulator.

Overview

BLoC Pattern

The BLoC pattern is a state management approach in Flutter that separates the business logic from the UI layer. This project demonstrates how to organize your code using BLoC to handle events and manage states in a clean and scalable manner.

Project Structure

  • lib/features/counter_event.dart: Defines events related to the counter feature.
  • lib/features/counter_state.dart: Represents the states for the counter feature.
  • lib/counter_block.dart: Implements the CounterBlock class, which extends the BLoC class and initializes with an initial state.
  • lib/main.dart: Contains the main application code, where the BLoC Provider and BLoC Builder are used.

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Contributions are welcome!

About

This is a project that shows how to use the Flutter BLoC pattern. It teaches how to work with events, states, and the BLoC class. Additionally, it demonstrates the use of the BLoC Builder along with BLoC Provider.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published