Reactive Programming - BLoC - Practical Use Cases and Patterns

Overview

Reactive Programming - BLoC - Practical Use Cases and Patterns

Source code of the article available on didierboelens.com

This article introduces some practical use cases of the BLoC pattern:

  • Event-State

    Sometimes, handling a series of activities which might be sequential or parallel, long or short, synchronous or asynchronous and which could also lead to various results, can become extremely hard to program. You might also require to update the display along with the progress or depending on the states.

    This first use case is aimed at making it easier to handle such situation.

  • Form Validation

    How to make it easier to automate a Form fields content validation and Widgets accessibility, based on Business Rules?

    This second use case shows how to achieve this, separating the business rules from the View.

    As a bonus, it also shows how to answer a question very frequently asked: "how to check if a password and retyped password match?".

  • Part Of

    This last use case explains how easy it is, thanks to the BLoC pattern, to make an isolated Widget behavior adapt based on its presence in a set.

    The source code, through a embryo of a Shopping Basket application, shows how a Widget knows it is part of the Shopping Basket or not, and how it can adapt its behavior accordingly.


Updated (20 DEC 2018)

  • Code clean up

  • Additional version of the "DecisionPage" (see decision_page_no_business.dart) This version of the page does not contain any Business Logic but externalizes the Business Logic via the [DecisionStateTransform] which extends the [BlocStateTransformBase]

You might also like...

With Bloc - Path Provider - Hydrated Bloc

With Bloc - Path Provider - Hydrated Bloc

Intro Custom Default Counter App on Flutter. The updated : Flutter Bloc / Cubit + Path Provider + Hydrated Bloc + Store Data using Hive Check the scre

Oct 30, 2021

A cross platform todo list app using flutter and dart programming language

A cross platform todo list app using flutter and dart programming language

Flutter Todos A cross platform todo list app using flutter and dart programming language. In this application, I used SQLite3 to persist data. The app

Dec 29, 2022

This is a mobile application that goals to build a quiz about programming subjects writter with Flutter.

This is a mobile application that goals to build a quiz about programming subjects writter with Flutter.

❓ DevQuiz A mobile application being built with NLW5 (an event from Rockeatseat - https://app.rocketseat.com.br/). This application goals to build a q

Dec 23, 2022

Memo is an open-source, programming-oriented spaced repetition software (SRS) written in Flutter.

Memo is an open-source, programming-oriented spaced repetition software (SRS) written in Flutter.

English | Portuguese Memo Monorepo for Memo. Memo is an open-source, programming-oriented spaced repetition software (SRS) written in Flutter. As of n

Dec 30, 2022

UI design for mobile, create using visual studio code & flutter dart programming languange

HCIProjectLab A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Oct 13, 2021

OOTP (Open One-time Password) is a supports multiple programming languages.

OOTP (Open One-time Password) is a supports multiple programming languages. The generated one-time passwords are fully compliant with HOTP (HMAC-based One-time Password) and TOTP (Time-based One-time Password).

Nov 20, 2022

Machine learning algorithms in Dart programming language

Machine learning algorithms for Dart developers What is the ml_algo for? The main purpose of the library is to give native Dart implementation of mach

Jan 4, 2023

Weather-application - A weather application based on dart programming language

Weather-application - A weather application based on dart programming language

weather based mobile app A new Flutter project with dart programmingg language S

Nov 13, 2022

A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Jan 6, 2023
Owner
Didier Boelens
Didier Boelens
This Dashboard was made to show one of the use cases in which Flutter web is applied.

Dashboard Flutter Web This Dashboard was made to show one of the use cases in which Flutter web is applied. Tasks Improve the splash Screen Create Log

Celestino Lopes 96 Nov 2, 2022
Better video player for Flutter, with multiple configuration options. Solving typical use cases!

Better Player Advanced video player based on video_player and Chewie. It's solves many typical use cases and it's easy to run. Introduction This plugi

Jakub 733 Jan 3, 2023
A new practical project made with Flutter and some native widgets, movie API, provider state and more.

Flutter Movie App This project was created with Flutter and some native Widgets like SingleChildScrollView, Hero Animation, SliverAppBar, StreamBuilde

Paúl 4 Jul 12, 2022
Flutter App to save notes secure, using cryptography, clean architecture and some design patterns.

notes A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Gabriel Scotá 6 Mar 28, 2022
An app which shows the total number of covid cases, recovered, etc. As well as of particular country too.

covid_app Images of Project A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get

Priyam Soni 0 Oct 18, 2021
📱 Tracking the impact of COVID-19 cases based on your location, built in Flutter

Installation Download apk here Get on Github Releases, or Build on your own: git clone https://github.com/adityanjr/covid19-tracker.git flutter pub ge

Aditya Singh 33 Dec 26, 2022
An android app to track all details about Covid-19 cases.

covid19 A Covid19 app that shows all statistics about it. It fetches the most recent data about corona virus cases from across the world and shows the

Shubham Kumar 14 Sep 20, 2021
We are building an open database of COVID-19 cases with chest X-ray or CT images.

?? Note: please do not claim diagnostic performance of a model without a clinical study! This is not a kaggle competition dataset. Please read this pa

Joseph Paul Cohen 2.9k Jan 7, 2023
Flutter Andriod app to track cases in each country for Corona Virus Covid-19

corova_virus_app Flutter Andriod app to track cases in each country for Corona Virus Covid-19 app support historical data/dark mode/search by country/

null 21 Mar 5, 2022
A tracking app for tracking covid-19 cases around the world

?? COVID-19 Tracker A simple Flutter app to track COVID-19 cases. The data we provide is collected from World Health Organization (WHO), the US Center

Temitope Ajiboye 166 Nov 23, 2022