Flutter is Google's cross-platform framework for building Android, iOS and web apps from one codebase. These Flutter interview questions cover widgets, Dart basics and layouts for freshers, then state management, navigation, the widget lifecycle, platform channels, performance and testing for experienced Flutter developers.
30 questions · Updated
Reading answers is not the same as saying them.Practise Flutter questions out loud and get a score, what you missed and a model answer for each one.
Practise free with AIFlutter Interview Questions: 30 questions with model answers on this page.
Basic Flutter interview questions
Fundamentals, definitions and simple scenarios. Good for freshers and warm-ups.
1. What is Flutter, and how is it different from React Native?
Answer flow · 4 steps
1
Flutter is an open-source UI toolkit from Google that builds natively compiled apps for mobile, web and desktop from one Dart codebase.
2
It draws every pixel with its own rendering engine (Impeller), so the UI looks identical on all platforms.
3
React Native uses JavaScript and renders real native platform components.
4
Flutter often gives more consistent UI and smooth animations.
2. What is the difference between StatelessWidget and StatefulWidget?
A StatelessWidget has no mutable state; it builds once from its configuration and rebuilds only when its parent passes new values, such as a label or icon. A StatefulWidget has a separate State object that holds data which can change, and calling setState() tells Flutter to rebuild it, such as a counter or a form.
3. How do you build layouts in Flutter?
Answer flow · 3 steps
1
Everything is a widget.
2
Row and Column arrange children horizontally and vertically with mainAxisAlignment and crossAxisAlignment, Stack overlaps widgets, Container adds padding, margin, decoration and size, Expanded and Flexible share space, and ListView and GridView display scrolling lists.
3
MediaQuery and LayoutBuilder help make layouts responsive.
4. What Dart features should every Flutter developer know?
Sound null safety (String cannot be null, String? can, with ?, ?? and ! operators), final (assigned once at runtime) versus const (compile-time constant, which also lets Flutter reuse widgets), type inference with var, async and await with Future and Stream, classes with named and optional parameters, mixins, extension methods, records and pattern matching (Dart 3).
5. What is the difference between hot reload and hot restart?
Answer flow · 3 steps
1
Hot reload injects changed code into the running app and rebuilds the widget tree in under a second while keeping the current state, which makes UI work fast.
2
Hot restart restarts the app from scratch and resets state, needed after changing things such as initState logic, global variables or app start-up code.
3
A full rebuild is needed for native code or plugin changes.
6. What is pubspec.yaml?
Answer flow · 3 steps
1
pubspec.yaml is the project configuration file.
2
It holds the app name and version, the Dart SDK constraint, dependencies and dev_dependencies from pub.dev, and declarations for assets and fonts. flutter pub get downloads packages and pubspec.lock records the exact versions.
3
Packages should be chosen for maintenance, popularity and platform support.
7. What do MaterialApp and Scaffold do?
Answer flow · 3 steps
1
MaterialApp is usually the root widget: it sets the theme, routes or router configuration, localisation and the home screen, and provides Material Design behaviour.
2
Scaffold gives a standard screen layout with slots for an AppBar, body, floating action button, drawer, bottom navigation bar and SnackBars.
3
CupertinoApp gives an iOS-style equivalent.
8. How do you handle text input and forms?
TextField takes input, with a TextEditingController to read or set its value and listen to changes (disposed in dispose()). For forms, wrap TextFormField widgets in a Form with a GlobalKey<FormState>, give each a validator function, and call formKey.currentState!.validate() on submit. keyboardType, textInputAction and focus nodes improve the experience.
9. How do you add images, assets and fonts?
Answer flow · 3 steps
1
Place files in a folder such as assets/images, declare them under flutter: assets: in pubspec.yaml, and show them with Image.asset.
2
Network images use Image.network or the cached_network_image package for caching and placeholders.
3
Custom fonts are declared under fonts in pubspec.yaml and applied through the theme, or loaded with the google_fonts package.
10. What is the difference between ListView and ListView.builder?
Answer flow · 3 steps
1
A plain ListView with a children list builds every item at once, which is fine for a few items.
2
ListView.builder creates items lazily as they scroll into view using an itemBuilder and itemCount, so it handles long or infinite lists efficiently.
3
ListView.separated adds dividers, and GridView.builder does the same for grids.
11. What is BuildContext?
Answer flow · 3 steps
1
BuildContext is a handle to a widget's location in the widget tree.
2
It is used to look up inherited data such as Theme.of(context), MediaQuery.of(context) and Navigator.of(context), and providers.
3
A common mistake is using a context from above the widget that provides something, or using a context after an async gap when the widget may have been removed, which is checked with mounted.
Intermediate Flutter interview questions
Applied problems, trade-offs and questions about your own projects.
12. What is the widget lifecycle of a StatefulWidget?
createState creates the State object, initState runs once for initialisation such as starting controllers or subscriptions, didChangeDependencies runs when inherited widgets change, build runs whenever the UI needs to be drawn, didUpdateWidget runs when the parent rebuilds with new configuration, and dispose runs when it is removed, where controllers and streams must be closed.
13. Which state management approaches have you used?
setState for local widget state, InheritedWidget as the built-in base, Provider for simple app-wide state, Riverpod as a safer, compile-time-checked successor to Provider, BLoC or Cubit for separating business logic with streams in larger apps, and GetX for an all-in-one approach. I choose based on app size and team familiarity; Riverpod and BLoC are common in production.
14. What are keys in Flutter, and when do you need them?
Answer flow · 3 steps
1
Keys help Flutter identify widgets when the widget tree changes, so state stays with the right widget.
2
They are needed when reordering, adding or removing stateful widgets of the same type in a list, such as a list of text fields.
3
ValueKey and ObjectKey use data to identify widgets, UniqueKey forces a new widget, and GlobalKey accesses a widget's state from elsewhere.
15. How does navigation work in Flutter?
Navigator 1.0 uses a stack of routes with Navigator.push and Navigator.pop, and named routes. For larger apps with deep links and web URLs, the declarative Router API is used, usually through the go_router package, which defines routes and paths in one place, supports nested navigation, redirects for authentication and passing parameters.
16. How does asynchronous programming work in Dart?
Answer flow · 3 steps
1
A Future represents a single value available later, such as an HTTP response, handled with async and await and try/catch for errors.
2
A Stream delivers a sequence of values over time, such as location updates or Firestore changes, consumed with await for or listen.
3
Dart runs on an event loop in a single thread, so awaiting does not block the UI.
17. What are FutureBuilder and StreamBuilder?
Answer flow · 3 steps
1
They build widgets from the latest state of a Future or Stream.
2
The builder receives an AsyncSnapshot, so you show a loading indicator while waiting, an error message if hasError, and the data when it arrives.
3
The Future should be created once, for example in initState or a provider, not inside build, or it restarts on every rebuild.
18. How do you call APIs and parse JSON in Flutter?
Answer flow · 3 steps
1
Use the http or dio package to make requests, then decode the response with jsonDecode and convert it into model classes with fromJson factory constructors.
2
For larger models, json_serializable or freezed generate this code.
3
I keep networking in a repository layer, handle errors and timeouts, and parse large responses in a background isolate with compute.
19. How do you store data locally in Flutter?
shared_preferences stores small key-value settings, flutter_secure_storage stores tokens securely in the Keychain or Keystore, sqflite or drift provide SQLite for structured relational data, and Hive or Isar are fast NoSQL options. For offline-first apps I combine a local database with a sync layer to the server.
20. How does InheritedWidget work, and how does Provider build on it?
Answer flow · 3 steps
1
An InheritedWidget makes data available to all widgets below it, which read it with context.dependOnInheritedWidgetOfExactType, and it rebuilds dependants when the data changes.
2
Provider wraps this pattern in an easier API with ChangeNotifier, context.watch and context.read, and handles disposal.
3
Riverpod removes the dependency on BuildContext entirely.
21. How do you add animations in Flutter?
Answer flow · 3 steps
1
Implicit animations such as AnimatedContainer, AnimatedOpacity and AnimatedSwitcher animate automatically when properties change, which covers most needs.
2
Explicit animations use an AnimationController with a TickerProvider, Tweens and curves, for full control such as looping or chaining.
3
Hero animates shared elements between screens, and Lottie or Rive play designer-made animations.
22. How do you implement theming in Flutter?
Answer flow · 3 steps
1
Define a ThemeData with Material 3 (useMaterial3, the default), usually generated from a seed colour with ColorScheme.fromSeed, plus text styles and component themes, and pass it to MaterialApp along with darkTheme and themeMode for dark mode.
2
Widgets read colours from Theme.of(context).colorScheme instead of hard-coding them.
3
ThemeExtension adds custom brand values.
High level Flutter interview questions
System design, deep internals, leadership and tough follow-ups.
23. What are platform channels?
Answer flow · 3 steps
1
Platform channels let Dart code communicate with native Android (Kotlin or Java) and iOS (Swift or Objective-C) code, when you need a native API that has no plugin.
2
A MethodChannel sends method calls and results, an EventChannel streams events from native to Dart, and messages are passed asynchronously.
3
Pigeon generates type-safe channel code.
24. How do you improve Flutter app performance?
I profile with Flutter DevTools in profile mode, then use const constructors so widgets are not rebuilt, split large build methods into smaller widgets, use ListView.builder for long lists, avoid expensive work in build, cache and resize images, move heavy computation to isolates with compute(), and limit setState rebuilds to the smallest widget subtree.
25. How do you test a Flutter app?
Unit tests check functions and business logic, widget tests render a single widget in a test environment and interact with it using WidgetTester, and integration tests run the full app on a device or emulator using the integration_test package. Dependencies are mocked with mockito or mocktail, and golden tests compare screenshots to catch visual changes.
26. What are isolates?
Dart code runs in isolates, each with its own memory and event loop, so they share no state and communicate by passing messages. The UI runs in the main isolate, so heavy CPU work such as parsing large JSON, image processing or encryption should run in another isolate using compute or Isolate.run, which keeps animations smooth at 60 or 120 frames per second.
27. Explain the widget, element and render object trees.
Answer flow · 4 steps
1
Widgets are lightweight, immutable descriptions of the UI that are rebuilt often.
2
Elements are the long-lived instances that hold a widget's place in the tree and its state, and decide what to update when widgets change.
3
Render objects do layout and painting.
4
Flutter compares new widgets with existing elements and only updates render objects that changed, and the Impeller engine draws the frames.
28. How do you structure a large Flutter app?
Answer flow · 3 steps
1
I organise code by feature, with presentation (widgets and state controllers), domain (entities and use cases) and data (repositories, API and local data sources) layers.
2
State is managed with Riverpod or BLoC, dependencies are injected, models are generated with freezed, navigation uses go_router, and features communicate through repositories.
3
This keeps the app testable and easy to change.
29. How do you build and release a Flutter app?
I set up flavours or build configurations for development, staging and production, manage app signing (keystore for Android, certificates and provisioning profiles for iOS), and automate builds with Codemagic, GitHub Actions or fastlane. Releases go through internal testing tracks and TestFlight first, then staged rollouts, with crash reporting through Firebase Crashlytics or Sentry.
30. When might Flutter not be the right choice?
When the app depends heavily on the newest platform-specific features or native UI that must look exactly like each platform, when it is mostly a thin wrapper around complex native SDKs, when the team is already highly skilled in native development and only targets one platform, or for very small app size requirements. For content websites with SEO needs, Flutter web is weaker than standard web frameworks.
Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.