1.3 KiB
1.3 KiB
SharedInbox Flutter — Agent Guide
Code conventions
- No
ifchains where a pattern/match or data-driven approach works. - Fail loudly —
throw StateError(...)beats silent fallbacks. - New source files go under
lib/core/(interfaces/models),lib/data/(implementations), orlib/ui/(screens/widgets).
Drift (DB)
- Schema in
lib/data/db/database.dart. - After any schema change run:
dart run build_runner build --delete-conflicting-outputs - Generated
database.g.dartis committed — do not hand-edit it.
enough_mail (vendored)
- Located at
packages/enough_mail/— edit freely. - IMAP client helpers are in
lib/data/imap/imap_client_factory.dart.
Running
Flutter build dependencies (libgtk-3-dev, libepoxy-dev, libsecret-1-dev, etc.) are installed via apt — see the Flutter Linux docs. The nix dev shell provides only tools: task, fvm, stalwart-mail.
Enter the nix dev shell first: nix develop
# Code generation (must run after schema changes)
task codegen
# Desktop
task run
# Tests
task test
Adding a screen
- Create
lib/ui/screens/my_screen.dart. - Add a
GoRouteinlib/ui/router.dart. - No separate ViewModel file needed — use
ConsumerWidget/ConsumerStatefulWidgetdirectly with Riverpod providers.