2.1 KiB
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:
providerpackage withChangeNotifier - Providers:
lib/providers/directoryauth_provider.dart- Authentication statemap_provider.dart- Google Maps stateshare_provider.dart- Location sharing
- API:
lib/config/api.dart(base URL:https://family-safety.onrender.com/api) - Firebase: Config in
assets/firebase/, usesgoogle_mobile_ads - Localization:
flutter_localizationswithgen_l10n - Maps:
google_maps_flutter_webfor web platform
Key Constraints
- Web renderer: Must use
--web-renderer=htmlflag for web builds - Provider initialization: All providers must be initialized before use (see
tools/run_web.dart) - Firebase: Requires config files in
assets/firebase/ - 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_testframework - Run with
dart testorflutter 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_adsfor Firebase integration - Localization uses
gen_l10npackage - Map functionality depends on Google Maps API key (configured in map_provider.dart)