[{"id":"flutterbeginner-001","courseId":"flutter-beginner","domain":"widgets-layout","topic":"Everything is a widget","prompt":"A custom widget's build() method returns a Column that holds two Text widgets. What does Flutter do with those returned widgets next?","hint":"Follow what a build() method returns, one level at a time.","explain":"Flutter's UI is a tree of lightweight description objects, each written in terms of smaller ones. Only the bottom layer does real geometry work, so the layers above are cheap to create and discard.","source":"https://docs.flutter.dev/ui/widgets-intro","interaction":{"type":"single"},"options":[{"id":"a","text":"It keeps building the widgets each build() returns until it reaches widgets that represent a RenderObject.","why":"build() describes a widget in terms of lower-level widgets, and the framework builds those in turn until the layer that computes geometry is reached."},{"id":"b","text":"It draws the Column straight to the screen, since build() returns the final picture.","whyNot":"build() returns a description, not pixels; the framework goes on to build the widgets that description names."},{"id":"c","text":"It keeps the Column in memory unchanged for as long as the app runs.","whyNot":"Widgets are temporary objects; only State objects persist between build() calls."},{"id":"d","text":"It stops at the Column, since build() only has to describe one level of the tree.","whyNot":"The framework continues into the widgets build() returns, level after level, not just the first."}],"answer":"a","explanation":"build() describes a widget with lower-level widgets; the framework builds those in turn until it reaches widgets backed by RenderObjects, which compute and describe geometry.","concept":"build() describes a widget with lower-level widgets; the framework builds those in turn until it reaches widgets backed by RenderObjects, which compute and describe geometry.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Widgets are temporary descriptions; the framework builds them down to render objects that compute geometry."]},{"id":"flutterbeginner-002","courseId":"flutter-beginner","domain":"widgets-layout","topic":"StatelessWidget stores final arguments","prompt":"A StatelessWidget can keep a counter in a non-final field, increment it inside build(), and show the new count after each tap.","hint":"Think about where a value must live to survive a rebuild.","explain":"A stateless widget gets its values from its parent and keeps them in fixed fields. Values that must survive between rebuilds belong in an object that outlives each build call.","source":"https://docs.flutter.dev/ui/widgets-intro","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Changing a plain field does not ask Flutter to rebuild, and a stateless widget's values are re-supplied by its parent, so the count does not persist."},{"id":"b","text":"False","why":"A stateless widget has no State object to hold changing values; its fields are final and come from the parent."}],"answer":"b","explanation":"A StatelessWidget stores parent-provided arguments in final fields; values that change over time belong in a State object, which persists between build() calls.","concept":"A StatelessWidget stores parent-provided arguments in final fields; values that change over time belong in a State object, which persists between build() calls.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Only State objects persist between build() calls; a stateless widget's fields are final."]},{"id":"flutterbeginner-003","courseId":"flutter-beginner","domain":"widgets-layout","topic":"Hot reload versus hot restart","prompt":"You edit the body of initState() in a running app and press hot reload. The new code never runs. Which statement explains this?","hint":"Consider which code a reload actually re-executes.","explain":"A hot reload loads new code into a running app while keeping the state it already holds. Whether an edit has any visible effect depends on whether the modified code runs again after the reload.","source":"https://docs.flutter.dev/tools/hot-reload","interaction":{"type":"single"},"options":[{"id":"a","text":"Hot reload re-runs only the code involved in rebuilding widgets, and initState() is not run again.","why":"The page says a hot reload re-executes only code involved in rebuilding widgets, and names initState() as a function that is not run again."},{"id":"b","text":"Hot reload starts the app over from main(), so initState() always runs with the new code.","whyNot":"Hot reload does not run main() again, and it keeps the app's existing state."},{"id":"c","text":"Hot reload resets all state to its initial values, so the edited initState() takes effect.","whyNot":"Hot reload preserves the app's state rather than resetting it."},{"id":"d","text":"Hot reload is rejected for any change inside a State class, so nothing is applied.","whyNot":"Rejections come from cases such as compilation errors; a plain edit to a State class is not on the page's list of special cases."}],"answer":"a","explanation":"Hot reload rebuilds existing widgets and re-executes only the code involved; state is preserved, and main() and initState() are not run again.","concept":"Hot reload rebuilds existing widgets and re-executes only the code involved; state is preserved, and main() and initState() are not run again.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Because hot reload keeps state, startup-only code such as initState() does not run again on reload."]},{"id":"flutterbeginner-004","courseId":"flutter-beginner","domain":"widgets-layout","topic":"Row and Column layout","prompt":"Which TWO statements about arranging children in Row and Column are correct?","hint":"Check which direction each property controls for a Row versus a Column.","explain":"A linear layout takes a list of children and lines them up along one direction. Its two alignment settings act on different directions, and which direction is which depends on the orientation.","source":"https://docs.flutter.dev/ui/layout","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Setting mainAxisAlignment to spaceEvenly on a Column divides the free vertical space evenly between, above, and below each child.","why":"The page's Column example does exactly this: the free vertical space is split evenly around each image."},{"id":"b","text":"A child of a Row or Column can itself be a Row or Column, so layouts can nest.","why":"The page says each child can itself be a row or column, and so on."},{"id":"c","text":"mainAxisAlignment on a Row spaces children vertically, because rows stack their children.","whyNot":"For a row the main axis runs horizontally, so mainAxisAlignment spaces children along the horizontal direction."},{"id":"d","text":"A Column accepts only one child, so several widgets must be wrapped in a Row to stack.","whyNot":"Row and Column each take a list of child widgets."},{"id":"e","text":"crossAxisAlignment on a Column aligns children along its vertical main axis.","whyNot":"For a column, the cross axis runs horizontally, so crossAxisAlignment works side to side."},{"id":"f","text":"A Column scrolls on its own when content is too tall, so ListView is never needed.","whyNot":"Content too large for the space shows a yellow and black stripe; the page describes ListView as the layout that scrolls automatically."}],"answer":"ab","explanation":"Row and Column lay out a list of children along a main axis and a cross axis; mainAxisAlignment acts on the main axis, crossAxisAlignment on the cross axis, and children can nest.","concept":"Row and Column lay out a list of children along a main axis and a cross axis; mainAxisAlignment acts on the main axis, crossAxisAlignment on the cross axis, and children can nest.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["For a Row the main axis is horizontal; for a Column it is vertical."]},{"id":"flutterbeginner-005","courseId":"flutter-beginner","domain":"widgets-layout","topic":"Constraints go down, sizes go up","prompt":"A widget with several children is laid out. Put these steps of its layout pass in order, from first to last.","hint":"Positioning children needs information that only exists after they are sized.","explain":"Layout here is one pass through the widget tree, with information moving down into the tree and results moving back up. Think about what each box can know at the moment it has to choose.","source":"https://docs.flutter.dev/ui/layout/constraints","interaction":{"type":"sort","items":[{"text":"The widget receives its constraints from its parent.","why":"Layout begins when the parent hands down the bounds this widget must fit within."},{"text":"The widget tells each child its constraints and asks for its size.","why":"Each child is given its bounds one by one and answers with the size it wants."},{"text":"The widget places its children along the horizontal and vertical axes.","why":"Placement comes after sizing, because the widget needs each child's size to arrange them."},{"text":"The widget reports its own size to its parent.","why":"Last, the widget reports its final size upward, within the constraints it was given."}]},"options":[],"answer":"o:abcd","explanation":"Flutter lays out in one pass: a widget receives constraints, tells each child its constraints and asks for its size, positions the children, then reports its own size up.","concept":"Flutter lays out in one pass: a widget receives constraints, tells each child its constraints and asks for its size, positions the children, then reports its own size up.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Constraints go down, sizes go up, and the parent positions the children."]}]