A modern, feature-rich macro and nutrition tracking application built with Flutter.
- 📊 Track daily macronutrients (proteins, carbs, fats)
- 📱 Cross-platform support (iOS, Android, macOS)
- 📸 AI-powered food recognition
- 🔄 Health app integration
- 🎯 Custom goal setting
- 📈 Progress tracking
- 🌙 Light/Dark theme support
- 🔐 Secure authentication
- ☁️ Cloud data sync
- Flutter (latest version)
- Dart SDK
- Xcode (for iOS/macOS development)
- Android Studio (for Android development)
- An Apple Developer account (for iOS/macOS deployment)
- Clone the repository:
git clone https://github.com/yourusername/macrotracker.git
cd macrotracker
- Install dependencies:
flutter pub get
- Run the app:
flutter run
To use all features of the app, you'll need to set up:
- Supabase for backend services
- Google Sign-In credentials
- Apple Sign-In configuration
- PostHog for analytics
lib/
├── AI/ # AI-related functionality
├── auth/ # Authentication logic
├── camera/ # Camera and image processing
├── Health/ # Health app integration
├── models/ # Data models
├── providers/ # State management
├── screens/ # UI screens
├── services/ # Backend services
├── theme/ # App theming
├── utils/ # Utility functions
└── widgets/ # Reusable widgets
This project follows Flutter best practices and uses:
- Provider for state management
- Supabase for backend services
- PostHog for analytics
- Google's Gemini AI for food recognition
- Custom UI components for a consistent experience
flutter build ios --release
flutter build apk --release
flutter build macos --release
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Flutter team for the amazing framework
- Supabase for backend services
- PostHog for analytics
- All contributors and users of the app
MacroTracker implements a hard paywall approach using RevenueCat. A hard paywall blocks access to the entire app until a subscription is purchased. This is different from a soft paywall, which would allow partial access to app features.
The implementation uses a PaywallGate
component that wraps all routes in the app. This gate checks if the user has a valid subscription before allowing access to any screen.
Key features:
- Blocks all app functionality until a subscription is purchased
- No trial or free tier access
- Clear subscription options with RevenueCat's PaywallView
- Proper subscription status management
RevenueCat is used for:
- In-app purchase management
- Subscription validation
- Cross-platform subscription handling
- Paywall presentation
- PaywallGate: Wraps all routes and checks subscription status
- PaywallScreen: Handles displaying the RevenueCat paywall UI
- SubscriptionProvider: Manages subscription state throughout the app
The RevenueCat SDK is initialized in main.dart
with the appropriate API keys for each platform.
When submitting an app with a hard paywall, ensure:
- The full billed amount is clearly shown
- Introductory offer details (if any) are clearly disclosed
- Opportunity to cancel is clearly stated
- Terms & conditions and privacy policy are accessible
- No misleading marketing text
To test the paywall:
- Use RevenueCat sandbox mode for iOS
- Use Google Play testing tracks for Android
- Verify all subscription states are handled correctly
- The
allowDismissal: false
parameter ensures users cannot dismiss the paywall without subscribing - Subscription status is refreshed after any interaction with the paywall
- A snackbar message informs users that subscription is required if they attempt to dismiss the paywall