[{"id":"flutteradvanced-001","courseId":"flutter-advanced","domain":"widgets-layout","topic":"Gesture arena picks the winner","prompt":"A screen puts a horizontal drag handler and a vertical drag handler over the same area. The finger moves sideways far enough for the horizontal handler to claim it. What happens to the vertical handler?","hint":"Ask what happens to the competitors when one recognizer claims the gesture.","explain":"Several recognizers can watch one pointer and negotiate over which one handles it. A recognizer can withdraw at any time; the last one left takes the pointer. Think about the others if one acts before they drop out.","source":"https://docs.flutter.dev/ui/interactivity/gestures","interaction":{"type":"single"},"options":[{"id":"a","text":"It loses: the horizontal recognizer declares itself the winner, so the rest of the arena loses.","why":"A recognizer can declare itself the winner at any time, which makes all the remaining recognizers lose, including the vertical one."},{"id":"b","text":"Both handlers fire, because the arena lets several recognizers receive one pointer.","whyNot":"The page says one of the competing recognizers receives the gesture, or neither does; both never fire."},{"id":"c","text":"The vertical handler fires too, because its callbacks are non-null.","whyNot":"Non-null callbacks only decide which gestures a detector tries to recognize; they don't guarantee a win in the arena."},{"id":"d","text":"Nothing is decided until the finger lifts; then the recognizer that moved more wins.","whyNot":"A recognizer may declare the win at any time, not only at the end of the contact, so the arena doesn't wait for lift-off."}],"answer":"a","explanation":"The gesture arena lets competing recognizers for one pointer resolve: any recognizer may leave, or declare itself the winner, which makes all remaining recognizers lose.","concept":"The gesture arena lets competing recognizers for one pointer resolve: any recognizer may leave, or declare itself the winner, which makes all remaining recognizers lose.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Only one recognizer wins the arena; a claim by any recognizer makes the rest lose."]},{"id":"flutteradvanced-002","courseId":"flutter-advanced","domain":"widgets-layout","topic":"Pointer events bubble without stopping","prompt":"Put these steps of handling one pointer down event in the order the framework performs them.","hint":"Ask which step must come before the framework knows where to send anything.","explain":"Raw touch data is routed through the app's structure in stages. Some stages pick a destination; others carry the data onward. Can anything in the design halt it midway?","source":"https://docs.flutter.dev/ui/interactivity/gestures","interaction":{"type":"sort","items":[{"text":"Pointer down event fires at the contact point","why":"The screen reports a new contact first; nothing can be routed until that contact exists."},{"text":"Hit test finds the widgets under that point","why":"On pointer down the framework hit-tests the app to find which widget sits at that location."},{"text":"Event is dispatched to the innermost widget found","why":"The pointer down event, and later events for that pointer, go to the innermost widget the hit test found."},{"text":"Event bubbles up to every widget on the path to the root","why":"From the innermost widget, events travel up through each ancestor to the root, and nothing can stop them."}]},"options":[],"answer":"o:abcd","explanation":"On pointer down, a hit test finds the widgets under the contact; the event goes to the innermost one, then bubbles to the root, and nothing can stop it.","concept":"On pointer down, a hit test finds the widgets under the contact; the event goes to the innermost one, then bubbles to the root, and nothing can stop it.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Pointer events reach every widget on the path from the hit target to the root, and nothing can stop them."]},{"id":"flutteradvanced-003","courseId":"flutter-advanced","domain":"widgets-layout","topic":"Slivers inside a CustomScrollView","prompt":"In Flutter, a sliver is a separate scrollable widget that you nest inside a ListView to get elastic scrolling.","hint":"Ask whether the thing being described is a whole scroll view or a piece of one.","explain":"A scrollable area can be built from parts, and each part can be given special scrolling behavior. Think about what a part is in relation to the whole area it belongs to.","source":"https://docs.flutter.dev/ui/layout/scrolling/slivers","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"The page defines a sliver as a portion of a scrollable area, not a separate scrollable you nest inside another one."},{"id":"b","text":"False","why":"A sliver is a portion of a scrollable area that you can define to behave in a special way, such as for elastic scrolling."}],"answer":"b","explanation":"A sliver is a portion of a scrollable area that you can define to behave in a special way, such as for elastic scrolling.","concept":"A sliver is a portion of a scrollable area that you can define to behave in a special way, such as for elastic scrolling.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Slivers let one scrollable area behave in custom ways, such as elastic scrolling; they are parts of it, not separate scrollables."]},{"id":"flutteradvanced-004","courseId":"flutter-advanced","domain":"widgets-layout","topic":"CustomPaint painter versus foregroundPainter","prompt":"A CustomPaint has a painter, a foregroundPainter and a Text child. Which part draws over the text, so its strokes appear on top of the words?","hint":"Ask which layer the framework draws after the child is painted.","explain":"A custom drawing widget can paint at more than one point relative to the content it wraps. Think about the sequence used around a child, and which layer ends up above the content.","source":"https://api.flutter.dev/flutter/widgets/CustomPaint-class.html","interaction":{"type":"single"},"options":[{"id":"a","text":"foregroundPainter","why":"It paints after the child has been painted, so its strokes land on top of the text."},{"id":"b","text":"painter","whyNot":"It paints before the child, so the Text is drawn over whatever the painter drew."},{"id":"c","text":"child","whyNot":"The child is painted in the middle of the sequence, before the foreground layer, so it is not on top."},{"id":"d","text":"Whichever painter is listed last in the constructor","whyNot":"Constructor order has no effect; the framework paints in a fixed sequence of painter, child, then foregroundPainter."}],"answer":"a","explanation":"CustomPaint asks its painter to paint first, then paints its child, then asks its foregroundPainter to paint, so the foreground layer sits above the child.","concept":"CustomPaint asks its painter to paint first, then paints its child, then asks its foregroundPainter to paint, so the foreground layer sits above the child.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["CustomPaint paints in a fixed order: painter, then child, then foregroundPainter."]},{"id":"flutteradvanced-005","courseId":"flutter-advanced","domain":"widgets-layout","topic":"AnimationController needs vsync","prompt":"When you define an AnimationController, you must pass in a vsync object, because its vsync parameter is required.","hint":"Think about what tells the controller that a new frame is due.","explain":"An animation controller moves its value once per screen refresh, driven by a ticker. Consider what it could do without a frame signal, and what the surrounding State offers to supply one.","source":"https://docs.flutter.dev/ui/animations/tutorial","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","why":"The page says you must pass in a vsync object, and it calls that the required vsync parameter."},{"id":"b","text":"False","whyNot":"The page calls vsync a required parameter, so the controller cannot be defined without it."}],"answer":"a","explanation":"AnimationController requires a vsync parameter, so you must pass a vsync object when you define one.","concept":"AnimationController requires a vsync parameter, so you must pass a vsync object when you define one.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["AnimationController requires vsync; dispose the controller when the State object is discarded to prevent memory leaks."]}]