Flutter Interview Questions and Answers
Fresher Level
Q: What is Flutter?
A: Flutter is an open-source UI toolkit by Google for building natively compiled applications for
mobile, web, and desktop from a single codebase.
Q: What is Dart, and why is it used in Flutter?
A: Dart is an object-oriented programming language developed by Google. It is used in Flutter for its
fast performance and ahead-of-time (AOT) compilation.
Q: Difference between StatelessWidget and StatefulWidget?
A: StatelessWidget is immutable and doesnt hold state, while StatefulWidget can rebuild itself based
on state changes.
Q: What is the pubspec.yaml file?
A: It's a configuration file that manages dependencies, assets, and metadata of the Flutter project.
Q: What is hot reload?
A: Hot reload allows injecting updated code into the running Dart VM, enabling UI updates without
restarting the app.
Intermediate Level
Q: How does Flutter handle state management?
A: Flutter supports state management via setState, Provider, BLoC, Redux, Riverpod, etc.
Q: What are keys in Flutter?
A: Keys help Flutter identify widgets uniquely in the widget tree, useful in lists and when reordering
widgets.
Q: Explain Navigator and routing in Flutter.
A: Navigator manages a stack of routes; you push or pop routes to navigate between screens.
Q: What are mixins in Dart?
A: Mixins are a way of reusing class code in multiple class hierarchies without using inheritance.
Q: How to handle async operations in Dart?
A: Using async/await with Future and Stream classes for non-blocking execution.
Advanced Level
Q: Difference between main() and runApp()?
A: main() is the apps entry point; runApp() attaches a widget tree to the screen.
Q: What is CustomPainter?
A: CustomPainter lets you create custom shapes and drawings by overriding paint and
shouldRepaint methods.
Q: What is WidgetsBindingObserver?
A: It listens to application lifecycle changes, such as app pause, resume, etc.
Q: Explain tree shaking in Flutter.
A: Tree shaking is the process of removing unused code to reduce app size during compilation.
Q: How to integrate platform-specific code?
A: Using platform channels to communicate between Dart and native code (Java/Kotlin,
Swift/Obj-C).