This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
All commands use the scripts defined in pubspec.yaml:
dart run build_runner build --delete-conflicting-outputs- Generate code (Riverpod, Freezed, JSON serialization)dart run build_runner watch --delete-conflicting-outputs- Watch mode for continuous generationdart run build_runner clean- Clean generated files
flutter test- Run all testsflutter test --coverage- Run tests with coverageflutter analyze- Run static analysisdart format lib/ test/- Format codedart format --set-exit-if-changed lib/ test/- Check code formatting
cd ios && pod install --repo-update- Install iOS dependenciescd ios && pod deintegrate && pod install- Clean iOS podscd android && ./gradlew clean- Clean Android build
flutter clean && flutter pub get && dart run build_runner build --delete-conflicting-outputs- Basic setupflutter clean && flutter pub get && dart run build_runner build --delete-conflicting-outputs && cd ios && pod install- Full setup with iOS
- Uses Riverpod 3.0 with code generation
- All providers use
@Riverpod()annotation and generate.g.dartfiles - Providers are organized in feature-specific directories
- Service providers are centralized in
lib/src/providers/services/
lib/src/
├── app/ # App-level configuration
│ ├── routing/ # GoRouter configuration with route guards
│ ├── startup/ # App initialization logic
│ └── theme/ # FlexColorScheme theme system
├── core/ # Shared utilities and widgets
│ ├── constants/ # App constants and enums
│ ├── exceptions/ # Error handling and custom exceptions
│ ├── network/ # Dio HTTP client and interceptors
│ ├── utils/ # Utility functions and extensions
│ └── widgets/ # Reusable UI components
├── data/ # Data layer
│ ├── models/ # Data models with Freezed
│ └── repositories/ # Repository implementations
├── features/ # Feature modules
│ ├── auth/ # Authentication feature
│ ├── home/ # Home screen feature
│ └── paywall/ # In-app purchase paywall
└── providers/ # Global providers
└── services/ # Service provider definitions- Firebase Auth integration with Google Sign-In
- Route guards prevent unauthorized access
- Auth state managed through Riverpod providers
- Supports email/password and Google OAuth
- Complete RevenueCat integration for in-app purchases
- Configurable paywall UI with hero animations
- Product management and subscription handling
- Comprehensive testing guide in
docs/paywall/testing-guide.md
- FlexColorScheme with Material 3 support
- Dynamic theme switching (light/dark/system/high contrast)
- Theme state persisted with SharedPreferences
- Detailed theme documentation in
lib/src/app/theme/README.md
- GoRouter with declarative routing
- Route guards for authentication
- Centralized route definitions with type-safe navigation
- Global error handling with custom exceptions
- Crashlytics integration for production error tracking
- Context-aware error messages
- Comprehensive failure types and error recovery
This project heavily uses code generation. Always run code generation after:
- Adding new Riverpod providers
- Modifying Freezed models
- Updating JSON serializable classes
- Changing route definitions
- Widget tests for UI components
- Unit tests for business logic
- Integration tests for complete user flows
- Paywall-specific testing scenarios documented
- Mock implementations available for testing
- Firebase Core, Auth, Crashlytics, and Firestore
- Configuration files:
lib/firebase_options.dart - Development and production environments supported
- Uses specific versions for core dependencies
- FlexColorScheme for theming
- Riverpod for state management
- GoRouter for navigation
- Dio for HTTP requests
- Freezed for immutable data classes
- Run
flutter pub getto ensure dependencies are installed - Run code generation if working with providers, models, or routes
- Check existing patterns in similar features before implementing new functionality
- Run
flutter analyzeto check for issues - Run
flutter testto ensure tests pass - Re-run code generation if you modified generated code dependencies
- Format code with
dart format
- Requires Xcode and CocoaPods
- Run pod install after dependency changes
- Firebase configuration:
ios/Runner/GoogleService-Info.plist
- Firebase configuration:
android/app/google-services.json - Minimum SDK version specified in build files