KeiSeiKit-1.0/_blocks/stack-flutter.md
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

1.5 KiB

STACK — Flutter + Riverpod + Clean Architecture

Use for cross-platform mobile UI (iOS + Android from one codebase).

State: Riverpod (flutter_riverpod ≥ 2.x) — NOT Provider, NOT GetX, NOT Bloc by default. Narrow providers (one responsibility each), autoDispose unless state is genuinely session-wide.

Layout — Feature-First + Clean Architecture:

lib/
  core/           shared utils, error handling, network, Result type
  features/
    <feature>/
      data/        DTOs, repositories impl, API clients
      domain/      entities, use cases, repository interfaces
      presentation/widgets, screens, providers

features/<A> CANNOT import features/<B> directly — cross-feature goes through core/ or a use case.

Pre-commit gate (MANDATORY):

flutter analyze   # zero warnings
flutter test      # all green

Both must pass. No commit without both. pubspec.lock is committed to git.

Merge-base gotcha: when merging multiple API timelines of different lengths (e.g. 15-day + 16-day feeds), use the LONGER timeline as base — otherwise day N+1 silently drops. Merge logic lives in exactly ONE use case (Single Source of Truth).

Secrets: --dart-define=KEY=value at build, or .env loaded at startup via flutter_dotenv. NEVER literal in lib/. .env in .gitignore.

Forbidden: Provider + Riverpod mixed, cross-feature imports, committing build/ or .env, file > 200 LOC / function > 30 LOC, merge logic duplicated across screens.