Skip to content

Mobile · updated 26 November 2026

Dart is the language behind Flutter apps. These scenarios cover widgets, state, async code and performance.

Top 10 Dart (Flutter) scenario questions

Try each one yourself first, then open the model answer.

1. Calling setState after leaving a screen throws an error. What do you do?

Show answer

Check the mounted property after awaits, and cancel timers and subscriptions in dispose.

2. Scrolling a long list is janky. How would you improve it?

Show answer

Build items lazily with ListView.builder, use const widgets, avoid heavy work in build, and cache images at the right size.

3. A FutureBuilder refetches data on every rebuild. Why?

Show answer

The future is created inside build. Create it once, for example in initState, and pass the stored future.

4. Parsing a very large JSON response freezes the UI. What can you do?

Show answer

Move the work to another isolate, for example with Isolate.run or compute.

5. The whole screen rebuilds when one counter changes. How do you narrow it?

Show answer

Move state closer to where it is used and rebuild only the dependent widgets with builders or a state management library's selectors.

6. Items in a reorderable list keep the wrong state after moving. What is missing?

Show answer

Stable keys, such as ValueKey with the item's id.

7. What is the difference between final and const in a widget you are optimising?

Show answer

final is set once at runtime. const is a compile-time constant, so identical const widgets can be reused and skipped during rebuilds.

8. A nullable value must be used safely. Which Dart features help?

Show answer

Sound null safety with ?, ??, null checks that promote local variables, and avoiding the ! operator unless the value is guaranteed.

9. A stream listener keeps firing after the page closes. How do you fix it?

Show answer

Store the StreamSubscription and cancel it in dispose, or use StreamBuilder which manages it.

10. The app must work offline. How would you design it?

Show answer

Cache data locally, read from the cache first, queue writes, sync when connectivity returns and define how conflicts are resolved.

Ready to build something great?

Book your free 30-minute consultation today. No obligation, just honest advice.