Question
An AI wrote this Flutter widget for a video-call screen that should re-acquire the camera and resume the call when the user returns from a backgrounding (e.g., took a phone call). It works if you stay in the app, but when the OS suspends and resumes the app, the camera preview stays black and the call doesn't reconnect. What's wrong and how would you fix it?
class CallScreen extends StatefulWidget { ... }class _CallScreenState extends State<CallScreen> { @override void initState() { super.initState(); _camera.initialize(); // only runs once, at first build _call.connect(); } // no didChangeAppLifecycleState handler}Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.