Skip to main content

Get Started

This guide will take you from a fresh clone to a running Vitu app with all features working.
1

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
2

Configure your Gemini API key

The Gemini API key is required for the food analysis feature to work. Without it, you cannot analyze food images or get recipe recommendations.
Open lib/main.dart and locate line 489:
const apiKey = 'AIzaSyCEwgwToG9cfPvf2wzNHGOhSeXCLafD1ms';
Replace this with your own API key from Google AI Studio:
const apiKey = 'YOUR_GEMINI_API_KEY_HERE';
For production apps, use environment variables instead. See Configuration for secure practices.
3

Choose your device

Select a device to run on:View available devices:
flutter devices
Options:
  • Android emulator/device
  • iOS simulator/device (macOS only)
  • Chrome (for testing, limited sensor support)
  • Windows/macOS/Linux desktop
4

Run the app

Launch Vitu:
flutter run
Or for a specific device:
flutter run -d <device-id>
The app will compile and launch. First build may take 2-5 minutes.
5

Wait for the splash screen

The app opens with an animated splash screen showing the Vitu logo with scale and fade animations.After the animation completes, you’ll be redirected to the login screen (first run) or the main app (if you’ve logged in before).

First Run Experience

1

Create your account

On the registration screen, enter:
  • 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.
Tap the register button to create your account.
2

Log in

After registration, or on subsequent launches, log in with:
  • Your email
  • Your password
The app validates credentials against the local Hive database and saves your session.
3

Grant permissions

On first access to certain features, you’ll be prompted for permissions:Location - Required for:
  • Step counting
  • Activity detection (walking vs. vehicle)
Camera - Required for:
  • Taking photos of food
Photo Library - Required for:
  • Selecting existing food images
Grant these permissions to unlock all features.

Try Each Feature

Home - Food Analysis

1

Navigate to Home

The bottom navigation bar has 5 tabs. Home (house icon) is the first tab.
2

Analyze food

  1. Tap the “Tomar Foto” button
  2. Choose Camera or Gallery from the bottom sheet
  3. Select or capture a photo of food
  4. Wait for Gemini AI analysis (usually 5-10 seconds)
The app will display:
  • Detected dish name
  • Nutritional breakdown (calories, protein, carbs, fats)
  • Interactive pie chart of macronutrients
3

View recipe recommendations

Scroll down to see 3 AI-generated healthy recipes personalized to your profile (age, weight, height, gender).For each recipe, you can:
  • View Ingredients
  • View Preparation steps (generated on-demand)
  • View Nutritional estimate

Exercise - Step Tracking

1

Navigate to Exercise

Tap the second tab (dumbbell icon).
2

Start moving

The app automatically counts steps using:
  • Device accelerometer (sensors_plus)
  • Location services (geolocator)
Smart features:
  • Detects walking vs. running by acceleration threshold
  • Ignores steps when moving >15 km/h (in a vehicle)
  • Persists daily totals to Hive database
3

Monitor activity

View your:
  • Current step count
  • Activity type (walking/running/idle)
  • Daily goal progress

Hydration - Water Tracking

1

Navigate to Hydration

Tap the third tab (water drop icon).
2

Log water intake

Tap quick-add buttons:
  • +100 ml
  • +250 ml
  • +500 ml
Each tap:
  1. Adds the amount to your daily total
  2. Updates the circular progress indicator
  3. Saves to Hive (hydration_logs box)
3

View progress

The screen shows:
  • Circular progress - Percentage of daily goal
  • Weekly chart - Last 7 days of hydration
  • Daily goal - Calculated from your weight (~35 ml/kg) or custom setting
Progress resets to 0% at the start of each day.

Sleep - Automatic Tracking

1

Navigate to Sleep

Tap the fourth tab (moon icon).
2

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)
The app:
  • 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
3

View sleep data

The screen displays:
  • Weekly chart - Hours slept each night
  • Sleep log - List of recent nights with quality ratings
  • Edit quality - Tap any night to adjust the rating

Settings - Customization

1

Navigate to Settings

Tap the fifth tab (gear icon).
2

Customize appearance

Adjust:
  • Theme - Light or Dark mode
  • Seed color - App accent color (affects UI throughout)
  • Font family - Typography (default, serif, etc.)
3

Update personal data

Edit your:
  • Name, age, height, weight, gender
  • Hydration goal (custom ml per day)
4

Manage account

  • Change password
  • Log out - Returns to login screen

Common Issues

”Error de conexión con Gemini”

Problem: Gemini API cannot connect. Solutions:
  1. Verify your API key is valid
  2. Check internet connection
  3. Ensure the key has Gemini API enabled in Google Cloud Console
  4. Generate a new key at Google AI Studio

”No se pudo estimar nutrientes”

Problem: Food analysis failed to parse results. Solutions:
  1. Ensure the photo clearly shows food
  2. Try a different image with better lighting
  3. Check that you’re using the correct Gemini model (gemini-2.5-flash in lib/main.dart:493)

Location permission denied

Problem: Step tracking doesn’t work. Solutions:
  1. Go to device Settings → Apps → Vitu → Permissions
  2. Grant “Location” permission
  3. On iOS, select “While Using the App”

Steps not counting

Problem: Exercise screen shows 0 steps. Solutions:
  1. Ensure location permission is granted
  2. Move around while holding the device
  3. Check that you’re not in a vehicle (>15 km/h)
  4. 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

Build docs developers (and LLMs) love