qbcps_flutter 0.1.1

qbcps_flutter #

A collection of utility classes that I wind up using in multiple projects.

None of these is particularly complicated, but in the interest of reuse I put them in this library rather than copy them all over the place.

Probably the class with the most utility for other folks is MapDB, which is just a map-backed database, as the name suggests. I wrote it as a stand-in for Firebase so I could do offline development, and it comes in handy for writing test cases.

[0.1.1] - 2020.02.11

  • Added configuration for continuous integration with FireCI.
  • Added method to MapDB to provide a Stream of all the values

[0.1.0] - 2019.06.17


  • Changed CircularArray to be an Iterable issue #7
  • Changed the layout of the files in the project and changed the project to be pure Dart and not depend on Flutter. issue #8

[0.0.4] - 2019.06.13

[0.0.3] - 2019.06.04

  • Added CircularArray
  • Added NotificationManager

[0.0.2] - 2019.06.04

  • Added documentation comments to MapDB.

[0.0.1] - 2019.06.03

  • Initial release, with two classes: MapDB, an in-memory database that acts a bit like Firebase, and AccumulatorStream, a stream that performs a transformation on a collection of futures and fires an event when they're all done.


import 'package:qbcps_flutter/qbcps_flutter.dart';
import 'package:tuple/tuple.dart';

/// Example code showing how to use [MapDB]

void main() {
  MapDB<String, String> stringDatabase = MapDB<String, String>();

  stringDatabase.getChangeStream().listen((Tuple2<String, String> data) {
        "Change stream just reported that key: ${data.item1} was assigned value: ${data.item2}");

  stringDatabase.getChangesForKey("A_Key").listen((String value) {
    print("Change stream for key `A_Key` reports value: $value");

  String oldValue = stringDatabase.put("A_Key", "A_value");
  print("The freshly created MapDB contained $oldValue for key 'A_Key'");

  String freshlySetValue = stringDatabase.get("A_Key");
  print("Fetched value $freshlySetValue for key 'A_Key'");

  // both change streams will emit a data event for this
  stringDatabase.put("A_Key", "A_second_value");

  // only the database change stream (not the change stream for key 'A_Key') will emit data for this
  stringDatabase.put("B_Key", "B_value");


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  qbcps_flutter: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:qbcps_flutter/qbcps_flutter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Format lib/qbcps_flutter.dart.

Run dartfmt to format lib/qbcps_flutter.dart.

Format lib/src/circular_array.dart.

Run dartfmt to format lib/src/circular_array.dart.

Format lib/src/map_db.dart.

Run dartfmt to format lib/src/map_db.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
tuple ^1.0.2 1.0.3
Transitive dependencies
matcher 0.12.6
meta 1.1.8
path 1.6.4
quiver 2.1.2+1
stack_trace 1.9.3
Dev dependencies
pedantic ^1.0.0
test ^1.5.0