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 runTo 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 --releaseflutter build apk --releaseflutter build macos --releaseContributions 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 Superwall for paywall presentation and RevenueCat for subscription management. A hard paywall blocks access to the entire app until a subscription is purchased.
The implementation uses a SuperwallGate component that wraps all routes in the app. This gate integrates with Superwall to present paywalls and checks RevenueCat for subscription validation.
Key features:
- Blocks all app functionality until a subscription is purchased
- Remote paywall configuration via Superwall dashboard
- A/B testing and analytics through Superwall
- RevenueCat handles subscription management
- Proper subscription status management
Superwall is used for:
- Remote paywall configuration
- A/B testing capabilities
- Paywall presentation and UI
- Analytics and conversion tracking
RevenueCat is used for:
- In-app purchase management
- Subscription validation
- Cross-platform subscription handling
- Subscription status monitoring
- SuperwallGate: Wraps all routes and manages paywall presentation
- SuperwallService: Handles Superwall SDK integration
- SuperwallPlacements: Defines placement constants and helper methods
- SubscriptionProvider: Manages subscription state throughout the app
Both SDKs are initialized in main.dart:
- Superwall SDK with API key for paywall presentation
- RevenueCat SDK with API keys for subscription management
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: falseparameter 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