What problem does it solve?
Image generation from Flutter with Firebase AI Logic fails in non-obvious ways: first calls return empty responses due to billing, App Check, or missing responseModalities settings, and developers waste time debugging correct Dart code when the real problem is project configuration. This Skill provides the working call pattern, response parsing, and troubleshooting order for Gemini image models.
Core Features & Use Cases
- First-call diagnostics: Rule out the three configuration blockers (Blaze billing, App Check enforcement, responseModalities) before debugging code.
- Response handling: Walk interleaved text and image parts from a Candidate, report blockReason and finishReason, and handle empty or image-only responses gracefully.
- Photo input and sizing: Downscale user photos at pick time to avoid main-isolate base64 stalls, and control output with ImageConfig aspect-ratio and size enums.
- Prompting and testing guidance: Reference files cover prompt failure patterns (placeholder text painted into artwork, wardrobe persistence), and the four test layers from unit tests on response parsing to evals.
- Use Case: A user uploads a selfie and your Flutter app returns stylized artwork with a matching caption; this Skill covers the model call, photo downscaling, defensive JSON parsing of the caption, and what to do when no image comes back.
Quick Start
Ask your agent to add Gemini image generation to a Flutter screen using Firebase AI Logic, including billing and App Check setup checks.