3 different demos showing how to use bloc concurrency, before and after the Bloc 7.2.0 update.

Overview

Bloc Concurrency Demos

coverage style: very good analysis License: MIT

3 different scenarios demonstrating how to structure blocs to take advantage of concurrent event processing in Bloc 7.2/8.0. Each bloc is implemented twice: the old way using mapEventToState, and the new way using on () .

Video Streaming Demo

Demonstrates a bloc that listens to a stream.

Video streaming demo

Cloud File Storage Demo

Demonstrates a bloc that processes events concurrently.

Cloud file storage demo

Registration Form Demo

Demonstrates how to use custom event transformers.

Registration form demo

Generated by the Very Good CLI πŸ€–


Getting Started πŸš€

To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

*Bloc Concurrency Demos works on iOS, Android, and Web.


Running Tests πŸ§ͺ

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Working with Translations 🌐

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}
  1. Then add a new key/value and description
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    },
    "helloWorld": "Hello World",
    "@helloWorld": {
        "description": "Hello World Text"
    }
}
  1. Use the new string
import 'package:bloc_concurrency_demos/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.helloWorld);
}

Adding Supported Locales

Update the CFBundleLocalizations array in the Info.plist at ios/Runner/Info.plist to include the new locale.

    ...

    <key>CFBundleLocalizationskey>
	<array>
		<string>enstring>
		<string>esstring>
	array>

    ...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
β”œβ”€β”€ l10n
β”‚   β”œβ”€β”€ arb
β”‚   β”‚   β”œβ”€β”€ app_en.arb
β”‚   β”‚   └── app_es.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}

app_es.arb

{
    "@@locale": "es",
    "counterAppBarTitle": "Contador",
    "@counterAppBarTitle": {
        "description": "Texto mostrado en la AppBar de la pΓ‘gina del contador"
    }
}
Comments
  • refactor: remove coverage-ignore comments

    refactor: remove coverage-ignore comments

    Description

    • refactor: remove coverage-ignore comments

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [X] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by felangel 0
  • test: 100% line coverage

    test: 100% line coverage

    Description

    Add registration tests (and restructure some stuff to get coverage back to 100%)

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [x] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [x] πŸ—‘οΈ Chore
    opened by definitelyokay 0
  • Files tests

    Files tests

    Description

    Adds tests for the files feature

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [x] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [x] πŸ—‘οΈ Chore
    opened by definitelyokay 0
  • Fix string localization

    Fix string localization

    Description

    Move strings to localized string file

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by definitelyokay 0
  • refactor: minor updates to registration

    refactor: minor updates to registration

    Description

    • refactor: minor updates to registration

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [X] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by felangel 0
  • refactor: minor updates to video stream

    refactor: minor updates to video stream

    Description

    • refactor: minor updates to video stream

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [X] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by felangel 0
  • refactor: upgrade to very_good_analysis v2.4.0

    refactor: upgrade to very_good_analysis v2.4.0

    Description

    • refactor: upgrade to very_good_analysis v2.4.0

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [X] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by felangel 0
  • add MainActivity for Android build

    add MainActivity for Android build

    add missing MainActivity.kt for Android build

    added missing file

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [x] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by X0Rz1st 0
Owner
Very Good Ventures
A Very Good Flutter Development Consultancy (also @VeryGoodOpenSource)
Very Good Ventures
A musical Flutter app showing different sounds in the app

Xylophone_App A new Flutter project. A musical app showing different sounds in the app. Getting Started This project is a starting point for a Flutter

Avinandan Bose 2 Sep 9, 2022
Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Thorsten Lorenz 205 Dec 24, 2022
Quiz app contains flutter questions only and showing result what you got.kind of mcq pattern

quiz 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

jagadeesh 2 Jan 24, 2022
An Example project showing usage of drupal_linkset_menu flutter package

drupal_menu_flutter An Example project showing usage of drupal_linkset_menu flutter package Getting Started This project is a starting point for a Flu

Aqib Gatoo 4 May 11, 2021
An example showing how to handle common scrolling gesture conflicts in Flutter.

scroll_master An example showing how to handle common scrolling gesture conflicts in Flutter.

null 11 Nov 11, 2022
A simple recipe showing application made using Flutter , using card Views MaterialPageRoute etc.

recipes 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

Akash Srivastava 1 Oct 31, 2021
A simple Todo app designed to simply use GraphQL as backend and provide an easy to use UI/UX.

simple_todo_app A simple Todo app designed to simply use GraphQL as backend and provide an easy to use UI/UX. A breakdown of the project and explanati

Emir HalΔ±cΔ± 2 Oct 9, 2022
Flutter Login Page Bloc Pattern App Flutter Login Page Bloc Pattern App

gdgbloc 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

Pawan Kumar 99 Oct 20, 2022
Dogs Explorer - An app for purshasing and exploring different breeds of dogs

Bloc is a fantanstic state mangement approach in flutter β€” with bloc pattern we would be able to create very high quality and maintainable code if implemented right because bloc uses design pattern which we are most familiar with. This project would be used to show how well we can utilize bloc by building an app that shows dogs according to breeds, their characteristics and several images of dogs.

null 8 Oct 31, 2022
This project is an example of Apollo Federation which implements multiple different type of databases

This project is an example of Apollo Federation which implements multiple different type of databases(polyglot persistence model).

null 2 Feb 18, 2022
A new Flutter App where different types of quiz demonstrated

Quizzler_App A new Flutter project.A new Flutter App where different types of quiz demonstrated . Getting Started This project is a starting point for

Avinandan Bose 1 Mar 27, 2022
An app to display Meals according to different Cusines alongwith various filters available

An app to display Meals according to different Cusines alongwith various filters available

Amartya Yadav 3 Jul 4, 2022
(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

Ismael Shakverdiev 45 Jul 14, 2022
A fully responsive BMI calculator app made using flutter and dart with beautiful minimalistic user interface design and easy to use .

BMI_Calculator_Flutter A fully responsive BMI calculator app made using flutter and dart with beautiful minimalistic user interface design and easy to

null 1 Oct 9, 2021
To do and accomplishment app built with Flutter and Dart. Made use of Provider

Todioapp A todo and accomplishment app built with Flutter Getting Started This project is a starting point for a Flutter application. A few resources

Atuoha Anthony 2 Dec 10, 2022
News App - A News Flutter application using Bloc, Dio, and shared preferences

News App A new Flutter application. Getting Started Flutter application using Bl

Mohamed Awad 9 Nov 14, 2022
A social media app built using flutter, firebase and bloc.

Kasassy Generated by the Very Good CLI ?? A Very Good Project created by Very Good CLI. Getting Started ?? This project contains 3 flavors: developmen

Ritik Gupta 3 Mar 10, 2022
Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps. Preview Mobile Vertical Card Pager Web Web Link Insta

Jeongtae Kim 27 Dec 9, 2022
11t is an iOS and Android app for connecting to Mastodon, written in Flutter. 11t lets you use any Mastodon instance.

README 11t is an iOS and Android app for connecting to Mastodon, written in Flutter. I connect to Mastodon on mastodon.social, but everyone can start

Jeroen Smeets 88 Dec 23, 2022