Files
geo_front/AGENTS.md
T

2.1 KiB

AGENTS.md - Family Safety Frontend

Project Overview

Flutter web application for family location tracking. Built with Flutter web renderer.

Critical Commands

# Run web app (MUST use --web-renderer=html)
cd lib && dart run tools/run_web.dart -- --web-renderer=html

# Format code
dart format --help

# Get dependencies
dart pub get

Architecture

  • Entry point: lib/main.dart
  • State management: provider package with ChangeNotifier
  • Providers: lib/providers/ directory
    • auth_provider.dart - Authentication state
    • map_provider.dart - Google Maps state
    • share_provider.dart - Location sharing
  • API: lib/config/api.dart (base URL: https://family-safety.onrender.com/api)
  • Firebase: Config in assets/firebase/, uses google_mobile_ads
  • Localization: flutter_localizations with gen_l10n
  • Maps: google_maps_flutter_web for web platform

Key Constraints

  1. Web renderer: Must use --web-renderer=html flag for web builds
  2. Provider initialization: All providers must be initialized before use (see tools/run_web.dart)
  3. Firebase: Requires config files in assets/firebase/
  4. API: External API at https://family-safety.onrender.com/api

File Structure

lib/
  config/          # Configuration (API, etc.)
  providers/       # State management
  screens/         # UI screens
  services/        # Business logic
  utils/           # Utilities
  widgets/         # Reusable UI components
  main.dart        # Entry point

Testing

  • Test files in test/ directory
  • Uses flutter_test framework
  • Run with dart test or flutter test

Build System

  • Package manager: dart pub
  • Config: pubspec.yaml
  • Lockfile: pubspec.lock (keep updated)
  • Flutter version: 3.24.0 (ensure compatibility)

Important Notes

  • This is a web-only Flutter app (despite having android/ios/ etc. directories)
  • Uses google_mobile_ads for Firebase integration
  • Localization uses gen_l10n package
  • Map functionality depends on Google Maps API key (configured in map_provider.dart)