🤖 The Magic Prompt (Copy & Paste)
Study then Copy the prompt below and paste it directly into your AI coding tool (such as Google AI Studio, Bolt.new, or Cursor) to generate the Android project:
Act as an expert Android Developer specializing in Kotlin, Jetpack Compose, and the Google Gemini SDK.
I want to build a modern, visually appealing Android app for users who want quick, stress-free meal ideas.
Please provide the complete project structure, UI code, ViewModel logic, and Gemini API integration for an app with the following specifications:
### 1. App Overview & Core User Flow
- **Screen 1: Cuisine Roulette (Home Screen)**
- Display an interactive, animated spinning wheel divided into 8–10 popular cuisine segments (e.g., Italian, Mexican, Thai, Japanese, Indian, Mediterranean, American, Korean).
- Include a prominent "Spin" button (and optional touch-to-fling gesture) with smooth deceleration physics and haptic feedback.
- Once the wheel stops, highlight the selected cuisine and automatically transition (or show a "See Meals" button) to the next screen.
- **Screen 2: Popular Meals Grid**
- Display the selected cuisine as a header, along with a "Spin Again" button.
- Fetch 6 popular, quick-to-make meal ideas for that specific cuisine using the Gemini API.
- Display these meals in a 2-column vertical grid (`LazyVerticalGrid`). Each card should show the meal name, estimated prep/cook time (e.g., "25 mins"), a brief 1-sentence description, and a relevant Material Icon or placeholder illustration.
- Show a clean loading state (like a shimmer effect or spinner) while Gemini fetches the ideas.
- **Screen 3: Full Recipe & Instructions**
- When a user taps a meal card, navigate to a detail screen and fetch the full recipe via Gemini (or pass the generated details if pre-fetched).
- Organize the screen cleanly into: Meal Title, Total Time, Servings, a checkable Ingredients list, and numbered, easy-to-follow Step-by-Step Cooking Instructions.
### 2. Technical Requirements
- **Language & UI:** 100% Kotlin using Jetpack Compose and Material Design 3. Use a warm, appetizing color palette (e.g., vibrant oranges, deep reds, and clean cream/dark surfaces).
- **Architecture:** MVVM (Model-View-ViewModel) with `StateFlow` for UI state management and Jetpack Navigation Compose for moving between screens.
- **AI Integration:** Use the official `com.google.ai.client.generativeai` SDK.
- **Structured Output (Crucial):** Configure the Gemini model (`gemini-2.5-flash` for fast responses) to return **strict JSON** using `responseMimeType = "application/json"` and a defined `responseSchema`. Provide the Kotlin `@Serializable` data classes to parse the meal list and full recipes reliably without markdown formatting errors.
- **Error Handling:** Include graceful error states with a "Retry" button in case the network fails or the API rate-limits.
### 3. Deliverables Needed
Please provide:
1. The required `build.gradle.kts` dependencies (Compose, Navigation, Kotlin Serialization, and Google AI SDK).
2. The Kotlin data classes for the JSON schema.
3. The Gemini Repository/Service class handling the API calls.
4. The ViewModel managing the wheel state, meal grid state, and recipe detail state.
5. The complete Jetpack Compose UI code, including the custom `Canvas` implementation for the spinning wheel.