box 0.2.0

Dart Box #

A fluent Dart persistence API inspired by SQL. This library is still in an early phase of development. Currently Box has two implementations.

  • Box: a very simple implementation that runs completely in-memory.
  • FileBox: an in-memory implementation that persists data to a simple JSON file.

Support for various SQL and NoSQL databases is on the roadmap.


Box box = new FileBox('.box/test');
List<User> users = await box.selectFrom<User>()
users.forEach((user) => print(;

Use this package as a library

1. Depend on it

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

  box: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:box/box.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 Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health issues and suggestions

Document public APIs. (-0.66 points)

86 out of 87 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/mongodb.dart. (-1.49 points)

Analysis of lib/src/mongodb.dart reported 3 hints:

line 16 col 13: Use = to separate a named parameter from its default value.

line 183 col 23: Unnecessary new keyword.

line 247 col 13: DO use curly braces for all flow control structures.

Fix lib/src/core.dart. (-0.50 points)

Analysis of lib/src/core.dart reported 1 hint:

line 116 col 13: Avoid const keyword.

Fix lib/src/file.dart. (-0.50 points)

Analysis of lib/src/file.dart reported 1 hint:

line 153 col 13: DO use curly braces for all flow control structures.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/core.dart (Run dartfmt to format lib/core.dart.)
  • lib/file.dart (Run dartfmt to format lib/file.dart.)
  • lib/memory.dart (Run dartfmt to format lib/memory.dart.)
  • lib/src/memory.dart (Run dartfmt to format lib/src/memory.dart.)

Maintenance issues and suggestions

Provide a file named (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (inflection2, mongo_dart).

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 2 dependencies without version constraints. Specify version ranges for the following dependencies: firebase, meta.

The package description is too short. (-15 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and box.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
collection ^1.14.11 1.14.12
firebase any 7.1.0
inflection2 0.4.2 0.4.2 0.4.3
io ^0.3.3 0.3.3
meta any 1.1.8
mongo_dart ^0.3.5 0.3.6 0.4.0
reflective ^0.1.1 0.1.8
Transitive dependencies
async 2.4.0
bson 0.3.2
charcode 1.1.2
convert 2.1.1
crypto 2.1.4
fixnum 0.10.11
http 0.12.0+2
http_parser 3.1.3
js 0.6.1+1
logging 0.11.3+2
mongo_dart_query 0.3.2 0.4.1
more 1.18.2
path 1.6.4
pedantic 1.9.0
pool 1.4.0
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
uuid 2.0.4
Dev dependencies
test any