My App

AGENTS

SmartCrew Mobile - AGENTS

Repository Guidelines

Project Structure & Module Organization

  • lib/ — main source code
    • components/ reusable widgets; screens/ app pages
    • services/ domain logic (e.g., logs/, location/, notifications/)
    • models/, providers/, repositories/, theme/, util/, animations/, gen/
  • assets/ — images/fonts; declare in pubspec.yaml
  • test/ — 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 dependencies
  • flutter analyze — static analysis/lint
  • flutter test — run all tests; add --coverage for coverage
  • flutter run -d <device> — run locally (e.g., -d ios, -d chrome)
  • flutter build apk --release / flutter build ios --release — release builds
  • dart 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 in components/
  • Run flutter analyze before pushing; follow analysis_options.yaml

Testing Guidelines

  • Mirror lib/ structure in test/; name files *_test.dart
  • Focus: unit tests for services/ and providers/, widget tests for components/
  • 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 (if lcov available)

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 analyze and tests; mention any follow-ups

Security & Configuration Tips

  • Do not commit secrets; keep .env local and documented
  • Firebase: update via flutterfire configure; changes regenerate lib/firebase_options.dart
  • Platform-specific changes in android/ or ios/ should be called out in PRs

On this page