If Gemini omitted a field or changed its response shape, the feedback screen could not read the data it expected.
The 12-hour MVP needed a small design that kept the API key out of the client and let Flutter distinguish success, failure, and retry states.
I routed Gemini requests through Firebase Functions, constrained output with JSON mode, and mapped it into screen models with JSON.parse. Runtime schemas, automatic retries, and error logging are not implemented.
- Specified required fields through the prompt and JSON mode.
- Kept the Gemini API key in Firebase Functions.
- Mapped JSON.parse results into Flutter feedback models.
Version 1.0.1 shipped on the App Store with this path. Delivery is verified; parsing success, latency, and missing-field rates were not measured.
I learned that asking for JSON is not a contract; failure becomes manageable only with runtime validation, retries, and logging.