Boilerplate for medium/large Flutter apps: Clean Architecture, Riverpod, go_router, and a single native plugin for SecureStore + on-device AI.
Read docs/architecture.md before adding a feature.
flutter pub get
flutter run --dart-define=FLAVOR=devDev defaults to DEMO_AUTH=true so sign-in works without a backend. Use any email and password.
- Sign in → Home
- Assistant → help / sample balance
- "transfer 2000 to Jane" → refused as generation, routed back to the signed shell
Copy .env.example to .env.local for machine-specific public config. Never put a client_secret in the app. Production OAuth is authorization code + PKCE.
- Create
lib/features/<name>/presentation. - When you need IO, add
domainports + use cases and adataadapter. - If the contract is shared (session, money, AI), promote the port to
lib/domain. - Wire implementations in
lib/app/di/providers.dartonly.
Do not import dio or hg_native from widgets. Do not import Flutter from lib/domain.
- Extend
packages/hg_native/pigeons/native_api.dart. - Implement Swift (
ios/Classes) and Kotlin (android/src/main/kotlin). - Expose a Dart port in
lib/domainand an adapter inlib/data/native. - Keep desktop/web on fakes (
HgNative.isPlatformSupportedis false).
cd packages/hg_native
dart run pigeon --input pigeons/native_api.dartmake ci # format + analyze + test (same as GitHub Actions quality)
make analyze
make test
make generate name=my_new_app
make check name=my_new_app
make cleanToolchain pin: .flutter-version.
GitHub Actions:
- PR /
main: format, analyze, tests (app +hg_native), debug APK - Tag
v*: GitHub Release with the debug APK
No Play / App Store upload in v1. iOS unsigned builds are documented as phase-2 CI (macos runner cost).
make generate name=my_new_appThe script rewrites hg_flutter, leftover dt_flutter / dtFlutter identifiers, and camelCase bundle IDs.