/brick

An intuitive way to work with persistent data in Dart

Primary LanguageDart

Build Status

An intuitive way to work with persistent data

An intuitive way to work with persistent data in Dart.

Why Brick?

What is Brick?

Brick is an extensible query interface for Dart applications. It's an all-in-one solution responsible for representing business data in the application, regardless of where your data comes from. Using Brick, developers can focus on implementing the application, without concern for where the data lives. Brick was inspired by the need for applications to work offline first, even if an API represents your source of truth.

Quick Start

  1. Add the packages:

    dependencies:
      brick_offline_first: any
    dev_dependencies:
      brick_offline_first_with_rest_build:
        git:
          url: https://github.com/greenbits/brick.git
          path: packages/brick_offline_first_with_rest_build
      build_runner: any
  2. Configure your app directory structure to match Brick's expectations:

    mkdir -p lib/app/adapters lib/app/db lib/app/models;

    Models must be saved in lib/app/models/<class_as_snake_name>.dart.

  3. Extend an existing repository or create your own:

    // lib/app/repository.dart
    class MyRepository extends OfflineFirstWithRestRepository {}