Get Started
This guide will take you from a fresh clone to a running Vitu app with all features working.Complete installation
If you haven’t already, complete the Installation guide first.Ensure you’ve:
- ✅ Installed Flutter SDK ^3.10.8
- ✅ Cloned the repository
- ✅ Run
flutter pub get - ✅ Obtained a Gemini API key
Configure your Gemini API key
Open Replace this with your own API key from Google AI Studio:
lib/main.dart and locate line 489:For production apps, use environment variables instead. See Configuration for secure practices.
Choose your device
Select a device to run on:View available devices:Options:
- Android emulator/device
- iOS simulator/device (macOS only)
- Chrome (for testing, limited sensor support)
- Windows/macOS/Linux desktop
Run the app
Launch Vitu:Or for a specific device:The app will compile and launch. First build may take 2-5 minutes.
First Run Experience
Create your account
On the registration screen, enter:Tap the register button to create your account.
- Name (nombre)
- Last name (apellido)
- Gender (género)
- Age (edad)
- Height in cm (altura)
- Weight in kg (peso)
- Email (correo)
- Password (contraseña)
All data is stored locally using Hive (NoSQL). No data is sent to external servers except for Gemini AI analysis.
Log in
After registration, or on subsequent launches, log in with:
- Your email
- Your password
Grant permissions
On first access to certain features, you’ll be prompted for permissions:Location - Required for:
- Step counting
- Activity detection (walking vs. vehicle)
- Taking photos of food
- Selecting existing food images
Try Each Feature
Home - Food Analysis
Analyze food
- Tap the “Tomar Foto” button
- Choose Camera or Gallery from the bottom sheet
- Select or capture a photo of food
- Wait for Gemini AI analysis (usually 5-10 seconds)
- Detected dish name
- Nutritional breakdown (calories, protein, carbs, fats)
- Interactive pie chart of macronutrients
Exercise - Step Tracking
Start moving
The app automatically counts steps using:
- Device accelerometer (
sensors_plus) - Location services (
geolocator)
- Detects walking vs. running by acceleration threshold
- Ignores steps when moving >15 km/h (in a vehicle)
- Persists daily totals to Hive database
Hydration - Water Tracking
Log water intake
Tap quick-add buttons:
- +100 ml
- +250 ml
- +500 ml
- Adds the amount to your daily total
- Updates the circular progress indicator
- Saves to Hive (
hydration_logsbox)
Sleep - Automatic Tracking
Understand automatic detection
Sleep is tracked automatically when:
- Screen is turned off (app enters paused state)
- Time is between 19:00 and 07:00 (with 10-minute margin)
- Records sleep start time
- Records wake time when screen turns on
- Clips duration to the valid window
- Assigns quality rating based on hours:
- Less than 6h = 2 stars
- 6-8h = 4 stars
- More than 8h = 5 stars
Settings - Customization
Customize appearance
Adjust:
- Theme - Light or Dark mode
- Seed color - App accent color (affects UI throughout)
- Font family - Typography (default, serif, etc.)
Update personal data
Edit your:
- Name, age, height, weight, gender
- Hydration goal (custom ml per day)
Common Issues
”Error de conexión con Gemini”
Problem: Gemini API cannot connect. Solutions:- Verify your API key is valid
- Check internet connection
- Ensure the key has Gemini API enabled in Google Cloud Console
- Generate a new key at Google AI Studio
”No se pudo estimar nutrientes”
Problem: Food analysis failed to parse results. Solutions:- Ensure the photo clearly shows food
- Try a different image with better lighting
- Check that you’re using the correct Gemini model (
gemini-2.5-flashinlib/main.dart:493)
Location permission denied
Problem: Step tracking doesn’t work. Solutions:- Go to device Settings → Apps → Vitu → Permissions
- Grant “Location” permission
- On iOS, select “While Using the App”
Steps not counting
Problem: Exercise screen shows 0 steps. Solutions:- Ensure location permission is granted
- Move around while holding the device
- Check that you’re not in a vehicle (>15 km/h)
- Restart the app
Next Steps
- Learn about Configuration best practices
- Explore the codebase in
lib/main.dart - Customize the app theme and colors
- Add new features following the Hive database pattern
Getting Help
For issues or questions:- Review the comprehensive README in the repository
- Check the source code comments in
lib/main.dart - Submit issues to the GitHub repository