The drawing engine is developed in-house (ADR 0005) and must stay independent from the UI, storage and state management. A convention alone (“do not import the UI from the engine”) is easy to break as contributors come and go.
The repository is a Dart pub workspace with two packages:
pastello/
├── pubspec.yaml # workspace root
├── app/ # the Flutter app
│ └── lib/src/
│ ├── app/ # MaterialApp, theme, routing
│ ├── core/ # shared utilities
│ ├── l10n/ # ARB translations
│ └── features/
│ ├── editor/
│ ├── gallery/ # gallery and trash
│ ├── stickers/ # content catalog and packs
│ ├── export/ # gallery export, share, print
│ └── parents/ # parental gate, about, backup
└── packages/
└── pastello_engine/ # the drawing engine
├── lib/src/
│ ├── document/ # Drawing, Element, serialization, migrations
│ ├── commands/ # undo/redo commands
│ ├── geometry/ # strokes, eraser, hit testing, lasso
│ └── rendering/ # painters, raster cache
├── test/ # unit and golden tests
└── benchmark/ # performance harness
pastello_engine depends only on Dart and Flutter’s rendering APIs. It must
not depend on the app, Riverpod, the file system or platform plugins.core/.models/, views/, controllers/): common, but
spreads one feature across the whole tree.