Widgets, state management, layout, navigation and platform channels.
Your profile screen loads the user's details from an API. A function
fetchProfile() returns Future<Profile>. What is a Future, and what
do the async and await keywords do when you call this function?
A delivery app needs two things: the order details, fetched once when the screen opens, and the courier's position, which keeps changing while the screen is visible. Which one would you model as a Future and which as a Stream, and why?
You want a news screen to show a spinner while articles load, the list
when they arrive and a message if the request fails. How does
FutureBuilder help here, and which properties of the snapshot do you
check?
On a login screen, authService.signIn(email, password) returns a
Future that can fail with a wrong-password error or a network error.
How do you catch these errors in an async button handler, and what
should the user see?
A chat screen subscribes to new messages in initState with
messages.listen(...). What does listen return, and why does the
screen need to do something with it in dispose?
A button handler is marked async and loops over a million items to
compute statistics, with no await inside the loop. The app freezes
while it runs. Why doesn't async keep the UI responsive here?