Skip to content

Latest commit

 

History

History

01_simple

01 Flutter Drift Sample

Shows how to use drift by modelling a simple relational DB with a parent - child relationship using a foreign key constraints including cascade delete.

db relationships created with https://dbdiagram.io/

The example follows a domain driven approach where the domain entities are decoupled from the DB access objects.

code dependency graph created with https://pub.dev/packages/lakos

Furthermore table changes, following migrations and testing those are shown exemplary. See app_database.dart and generated_migrations for further information.

Build

  • git clone https://github.com/d-wolf/flutter_drift_sample.git
  • dart run build_runner build --delete-conflicting-outputs
  • flutter run