AGENTS
SmartCrew Mobile - AGENTS
Repository Guidelines
Project Structure & Module Organization
lib/— main source codecomponents/reusable widgets;screens/app pagesservices/domain logic (e.g.,logs/,location/,notifications/)models/,providers/,repositories/,theme/,util/,animations/,gen/
assets/— images/fonts; declare inpubspec.yamltest/— unit/widget tests (e.g.,test/provider/...)- Platforms:
android/,ios/ - Config:
pubspec.yaml,analysis_options.yaml,lib/firebase_options.dart,.env,firebase.json
Build, Test, and Development Commands
flutter pub get— install dependenciesflutter analyze— static analysis/lintflutter test— run all tests; add--coveragefor coverageflutter run -d <device>— run locally (e.g.,-d ios,-d chrome)flutter build apk --release/flutter build ios --release— release buildsdart format .— format code (CI-safe); equivalent:flutter format .
Coding Style & Naming Conventions
- Indentation: 2 spaces; keep lines within analyzer limits
- Files:
snake_case.dart(e.g.,work_logs_state_manager.dart) - Types: UpperCamel (
WorkLogsService); members/vars: lowerCamel (startTime) - Constants: lowerCamel (
defaultRadius); enums: UpperCamel values - Prefer composition over inheritance in
services/; keep widgets small and pure incomponents/ - Run
flutter analyzebefore pushing; followanalysis_options.yaml
Testing Guidelines
- Mirror
lib/structure intest/; name files*_test.dart - Focus: unit tests for
services/andproviders/, widget tests forcomponents/ - Examples:
- Single file:
flutter test test/provider/services/switch_log_service_test.dart - Coverage html:
flutter test --coverage && genhtml coverage/lcov.info -o coverage/html(iflcovavailable)
- Single file:
Commit & Pull Request Guidelines
- Commits: imperative mood, concise scope (e.g.,
fix: end time,feat: checkout questions) - PRs must include: problem/solution summary, linked issues, screenshots for UI, and notes for platform/Firebase changes
- Require green
flutter analyzeand tests; mention any follow-ups
Security & Configuration Tips
- Do not commit secrets; keep
.envlocal and documented - Firebase: update via
flutterfire configure; changes regeneratelib/firebase_options.dart - Platform-specific changes in
android/orios/should be called out in PRs