Skip to content

ProjectAJ14/flutter_bloc_workshop

Repository files navigation

flutter_bloc_workshop

Flutter bloc workshop. This project contains 3 different sample projects that are used to demonstrate the use of bloc in flutter.

  1. Counter App (Using cubit)

  2. Timer App (Using bloc and bloc_test)

  3. Product App (Complete application with MVVM architecture using bloc)

Pre-requisites

  1. Flutter SDK version 3.13.6 or above

Getting Started

All the sample projects are in different branches. To get started, clone the repo and checkout the branch you want to work on.

git clone
git checkout <branch-name>

Introduction

All the projects have a common structure. The project structure is as follows:

lib lib/app - Contains the application-specific code lib/data - Contains the data layer code (Repository, API, Database) lib/feature - Contains the feature-specific code lib/utils - Contains the utility code

Branches

Initial Setup step-1: flutter setup with dependencies

Counter App

step-2.0: initial setup for cubit 
step-2.1- completed setup for cubit

Timer App

step-3.0: initial setup for  bloc
step-3.1- completed setup for bloc
step-3.2: example app with test cases without Expect
step-3.3: example app with completed test cases 

Product App

step-4.0: folder structure and files for app
step-4.1: code for bloc and UI without connections
step-4.2: complete code

Counter App

Branch: step-2.1

This is a simple counter app that uses a cubit to manage the state.

Cubit Example

Timer App

Branch: step-3.3

This is a simple timer app that uses Bloc to manage the state. It also uses bloc_test to test the bloc. Also, a custom bloc observer to log the state changes.

Bloc Example 1 Bloc Example 2

Product App

Branch: step-4.2

This app has MVVM architecture using bloc. This app has two screens - Categories and Product List. The app uses the bloc to manage the state. It also uses go_route to navigate between the screens.

App 2 App 1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published