Working with Flutter Code
Understand the generated project structure to write more effective prompts.
Most successful Primio apps follow a four-phase process: build the foundation, add features one at a time, polish the details, then publish. Trying to skip phases or combine them leads to wasted tokens and frustrating results.
Recommended model: Auto or Opus
Your first prompt should describe the skeleton of your app: screens, navigation, data model, and visual style. Don’t request features yet. Get the structure right first.
A good first prompt looks like this:
Create a recipe app with 4 screens: Home (recipe grid with images), Recipe Detail (ingredients, steps, cook time), Add Recipe (form with image upload), and Favorites. Use bottom navigation. Dark theme with orange accents and rounded cards.
This gives the AI enough to build a complete, navigable app in one shot. Review the live preview and check:
If the foundation is wrong, roll back and rephrase. It’s much cheaper to fix the foundation now than to course-correct later with features already built on top.
Recommended model: Auto or Sonnet
Add features one at a time, verifying each before moving on. This gives you granular rollback checkpoints and lets the AI focus on getting each feature right.
Example feature sequence for the recipe app:
Each message should describe one feature completely. Include visual details, placement, and behavior — not just functionality.
Use @file: references to direct changes to specific files when you know where the code lives. For example:
In
@file:lib/screens/home_screen.dart, add a floating action button in the bottom-right corner that navigates to the Add Recipe screen.
See Attaching Context for more on file references.
Recommended model: Sonnet
With all features working, focus on refinement. This is where your app goes from functional to polished.
Design polish:
Edge cases:
Code cleanup:
Open the Prompt Library and use “Review & Simplify Code” after major changes. This asks the AI to clean up the codebase without changing functionality.
Device testing:
This is critical. The web preview is not a device emulator. Build an APK (20K tokens) or use Web Hosting (free) and test on a real device. You’ll catch issues with scroll behavior, touch targets, animations, and platform-specific rendering that don’t show up in the preview.
Once your app is tested and polished, prepare for release.
Set a custom app icon
Go to Workspace → App Icon and upload your own icon. Don’t publish with the default template icon — stores may reject it, and users won’t take it seriously. See App Icon.
Build and test on device
Build an APK (Android) or IPA (iOS) and install it on a real device. Test every screen, every feature, every edge case. This is your final check before real users see it.
Prepare your store listing
Take screenshots on a real device. Write a clear app description. Choose relevant keywords. Create a feature graphic for Google Play. Write a privacy policy — both stores require one.
Submit to app stores
Follow the Google Play Submission Guide or App Store Submission Guide for step-by-step instructions.
Rollback early. If the AI goes in the wrong direction, don’t try to steer it back over five messages — that wastes tokens. Roll back to the last good state and rephrase. See Rollback.
Keep prompts focused. One feature per message. Verify before moving on. This gives you more rollback checkpoints and better results from the AI.
Match the model to the task. Opus for the foundation and complex features. Sonnet for general feature work, quick text changes, color tweaks, and small fixes. See Model Selection.
Test on a real device periodically. Not just at the end. Every few iterations. The web preview is a Flutter web build, not device emulation.
| Pitfall | Why it’s a problem | What to do instead |
|---|---|---|
| Describing the entire app in one message | The AI loses focus, misses details, produces a messy result | Use a phased approach — foundation first, then one feature at a time |
| Not testing on a real device until the end | Device-specific issues pile up and are expensive to fix retroactively | Test after the foundation phase and periodically during feature development |
| Watching the AI loop on errors without intervening | Error-fixing loops consume tokens rapidly with diminishing returns | Roll back when you see repeated similar fixes — the AI is stuck |
| Skipping the custom app icon | Stores may reject apps with template icons; users won’t trust a generic-looking app | Set a custom icon in Workspace → App Icon before building |
| Asking for too many changes at once | Harder to identify which change broke something; coarser rollback points | One feature per message, always |
Working with Flutter Code
Understand the generated project structure to write more effective prompts.
Debugging & Fixing Errors
Handle errors and AI loops when things go wrong during development.