Flutter interviews test the widget tree, why setState rebuilds, what BuildContext is, and how keys preserve State. Expect Stateless vs Stateful, const widgets, ListView.builder, and “don’t block the UI isolate.” Be ready to debug an unbounded constraint error out loud.
This Flutter cheat sheet is written for people searching for a fast, accurate reference: students, junior developers, and teams shipping production software. Pin it, copy the snippets, and come back when syntax slips.
Quick reference
- Trees: Widget (config) → Element (lifecycle) → RenderObject (layout/paint).
- setState: Marks this
Statedirty.buildruns again. Children may rebuild. - Keys: Local vs global.
ValueKeyon list items that hold State or keep scroll. - context: Handle to the location in the tree. Invalid after dispose.
of(context)looks up ancestors. - Inherited:
InheritedWidget/Provider/Riverpodfor data below a subtree. - async gap:
awaitthenif (!mounted) return;beforesetState. - Isolates: Separate memory. Heavy JSON parse / image work off the UI isolate (
compute). - Constraints: Parents pass constraints down; children return sizes. Unbounded + ListView is the classic crash.
Copy-paste examples
mounted check after await
Say this in an interview when they ask about setState after a Future.
Future<void> save(BuildContext context, Future<void> Function() send) async {
await send();
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Saved')),
);
}Common mistakes
- Explaining Flutter as “a WebView of Dart.”
- Cannot name a state library or
setStatetradeoff. - Using
contextacross async gaps withoutmounted. - No answer for how to keep a 1000-row list smooth.
FAQ
- Why const widgets? They can be reused and skipped in rebuilds when the configuration cannot change. Over-const is a style; missing const on list items can be a perf issue.
- Provider vs Riverpod vs BLoC? All solve sharing state. Name what you shipped. Interviews care that you lift state out of giant widgets.
- Hot reload vs restart? Reload injects into a running isolate and keeps State. Restart reruns
main. ChanginginitStatesignatures often needs restart.
Related Flutter cheat sheets
Build with this stack
When a cheat sheet is not enough — you need a production app, a student FYP, or a custom dashboard — ArpaNeuro builds mobile app development and also sells ready-made source code. Request a quote and tell us the stack.
Browse software development services or the source code marketplace if you want a working codebase instead of starting from a blank file.