Shows how to use drift by modelling a simple relational DB with a parent - child relationship using a foreign key constraints including cascade delete and a self referencing table.
The example follows a domain driven approach where the domain entities are decoupled from the DB access objects.
Furthermore table changes, following migrations and testing those are shown exemplary. See app_database.dart and generated_migrations for further information.
git clone https://github.com/d-wolf/flutter_drift_sample.git
dart run build_runner build --delete-conflicting-outputs
flutter run