Flutter Interview Questions & Answers (2025 Edition)
1. What is Flutter?
Flutter is Google’s UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase using Dart language.
2. Difference between StatelessWidget
and StatefulWidget
-
StatelessWidget
: Immutable, does not change over time. -
StatefulWidget
: Mutable, maintains state that can change.
3. What is hot reload
in Flutter?
Instantly updates the running app after code changes, without losing app state.
4. What are Widgets in Flutter?
Everything in Flutter is a widget: UI elements, layout elements, and even the app itself.
5. Difference between Container
and SizedBox
-
Container
: Adds decoration, padding, margin, constraints. -
SizedBox
: Only for spacing with fixed width/height.
6. Explain main.dart
main.dart
is the entry point of a Flutter app where runApp()
is called.
7. What is pubspec.yaml
?
Configuration file for dependencies, assets, fonts, and metadata of Flutter project.
8. How to add an image asset?
9. Difference between Column
and Row
-
Column
: Vertically aligns children -
Row
: Horizontally aligns children
10. What is the difference between const
and final
in Dart?
-
const
: Compile-time constant, immutable -
final
: Initialized once at runtime
Medium Questions (11–20)
11. Explain Flutter navigation
Flutter supports stack-based navigation using Navigator.push()
and Navigator.pop()
.
12. What is a Future
in Dart?
Represents a value that will be available later, usually for async operations.
13. Difference between async
, await
, and then()
-
async/await
: Syntactic sugar for readable async code -
then()
: Chaining futures
14. Explain Stream
in Dart
A stream emits a sequence of values over time, useful for real-time updates.
15. Difference between Hot reload
and Hot restart
-
Hot reload
: Updates UI, keeps state -
Hot restart
: Restarts app, loses state
16. How to implement themes in Flutter
17. Explain InheritedWidget
Used to pass data down the widget tree efficiently without passing through constructors.
18. Difference between Expanded
and Flexible
-
Expanded
: Fills available space -
Flexible
: Fills available space proportionally
19. How to manage state in Flutter
-
setState()
– basic state management -
Provider
– recommended for larger apps -
Riverpod
,BLoC
,GetX
– advanced state management
20. Explain GestureDetector
Detects gestures like tap, double-tap, swipe, and long-press.
Difficult Questions (21–30)
21. Explain Flutter’s widget lifecycle
-
initState()
: Called once when widget is inserted -
didChangeDependencies()
: Called when dependencies change -
build()
: Builds UI -
dispose()
: Called when widget removed
22. Difference between ListView.builder
and ListView
-
ListView
: Loads all children at once -
ListView.builder
: Lazily builds children for better performance
23. What is FutureBuilder
?
Widget that builds UI based on a Future’s state.
24. What is StreamBuilder
?
Widget that builds UI based on streamed data.
25. Explain Flutter’s rendering process
Flutter renders using a 3-layer architecture: Widget → Element → RenderObject.
-
Widgets: Immutable description
-
Elements: Runtime representation
-
RenderObjects: Handle layout and painting
26. Difference between Navigator 1.0
and Navigator 2.0
-
1.0: Stack-based, imperative
-
2.0: Declarative, handles deep linking and web routes
27. How to optimize Flutter app performance
-
Use
const
constructors -
Use
ListView.builder
instead ofListView
-
Avoid rebuilding widgets unnecessarily
-
Use
RepaintBoundary
andshouldRepaint
28. Explain BLoC pattern
Business Logic Component separates UI and business logic.
Uses Streams
to handle state.
29. How to handle JSON in Flutter
30. Difference between Hot reload
and app release
-
Hot reload: Development-time tool
-
Release mode: Compiled app for production
✍️ By Not available | 2025-10-21T09:08:21.967Z