A fun "scratch-to-reveal" mobile app that uses AI to generate personalized images based on what your camera sees and microphone hears in real-time.
- Real-time Capture: Simultaneously records 5 seconds of ambient audio and captures a photo
- AI Processing: Uses AI to transcribe audio and analyze visual scenes
- Creative Generation: Combines audio and visual inputs to create unique, magical AI images
- Scratch Reveal: Interactive scratch-to-reveal interface with metallic effect
- Sharing: Share your AI creations with friends via social media
- Cross-platform: Works on both iOS and Android
- Flutter SDK (3.0 or higher)
- Android Studio / Xcode for iOS development
- For iOS: CocoaPods installed
-
Clone the repository
git clone <repository-url> cd scratchlens
-
Install dependencies
flutter pub get
-
For iOS (macOS only)
cd ios pod install cd ..
-
Run the app
flutter run
The app requires the following permissions:
- Camera: To capture photos of your surroundings
- Microphone: To record ambient sounds
- Storage: To save and share generated images
- Framework: Flutter
- State Management: Provider
- Camera: camera plugin
- Audio Recording: record plugin
- Scratch Effect: flutter_scratch_card
- Sharing: share_plus
lib/
├── main.dart # App entry point
├── screens/
│ ├── home_screen.dart # Welcome screen
│ ├── capture_screen.dart # Recording & processing
│ └── reveal_screen.dart # Final result & sharing
├── services/
│ ├── camera_service.dart # Camera management
│ ├── audio_service.dart # Audio recording
│ └── ai_service.dart # AI processing (mock for MVP)
├── widgets/
│ └── scratch_card.dart # Scratch-to-reveal widget
└── models/ # Data models (future use)
Currently uses mock AI services for demonstration. To integrate real AI:
Replace AIService.transcribeAudio() with:
- Whisper (OpenAI) - on-device or API
- Google Speech-to-Text
- Azure Speech Services
Replace AIService.describeImage() with:
- CLIP Interrogator
- Google Vision AI
- Azure Computer Vision
Replace AIService.generateImage() with:
- Flux Schnell (via Replicate/Fal)
- Stable Diffusion XL Lightning
- DALL-E or Midjourney APIs
- Beach: Waves + seagulls + sand → Majestic dolphin jumping at sunset
- Café: Coffee machine + chatter + pastries → Giant croissant with sunglasses
- With Dog: Barking + pet → Dog as flying superhero
- Rainy Street: Rain + cars + umbrellas → Cyberpunk neon city reflection
- Free tier: 5 scratches/day
- Premium: Unlimited scratches + higher quality AI
- Cosmetic effects: Gold, rainbow, fire scratch effects
- Remix feature: Regenerate with different styles
- Subscription: $5-8/month for pro features
- Create new service class in
lib/services/ - Update
AIServiceto use real API endpoints - Add API keys to environment variables
- Update error handling and loading states
- Colors: Update gradients in theme
- Animations: Modify animation controllers
- Effects: Customize scratch card appearance
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or support, please open an issue on GitHub.
Made with ❤️ and AI magic ✨