0% found this document useful (0 votes)
27 views3 pages

Flutter Lab Viva Questions Guide

The document contains a comprehensive list of 50 viva questions and answers related to Flutter, covering topics such as the framework's features, Dart programming language, widget types, state management, and error handling. It also addresses navigation, async operations, and performance optimization techniques in Flutter applications. This resource serves as a study guide for individuals preparing for Flutter-related interviews or assessments.

Uploaded by

faziyamila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

Flutter Lab Viva Questions Guide

The document contains a comprehensive list of 50 viva questions and answers related to Flutter, covering topics such as the framework's features, Dart programming language, widget types, state management, and error handling. It also addresses navigation, async operations, and performance optimization techniques in Flutter applications. This resource serves as a study guide for individuals preparing for Flutter-related interviews or assessments.

Uploaded by

faziyamila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

UI Flutter Lab Viva Questions

1. What is Flutter?
Flutter is an open-source mobile app development framework created by Google. It allows developers to
build natively compiled apps for mobile, web, and desktop from a single codebase.
2. What is Dart?
Dart is the programming language used for Flutter app development. It's a modern, object-oriented language
that's easy to learn and use.
3. What are the benefits of using Flutter?
 Fast development and hot reload
 High-performance apps

 Single codebase for multiple platforms

 Large community and Google support

4. What is a widget in Flutter?


A widget is a basic building block of a Flutter app's UI. Everything in Flutter is a widget, from buttons to
layouts.
5. What is the difference between Stateful and Stateless widgets?
 Stateless widgets are immutable and can't change state once created.
 Stateful widgets can change state and are used for dynamic UI updates.

6. How do you manage state in Flutter?


There are several ways to manage state in Flutter, including:
 setState()
 InheritedWidget

 Provider

 Riverpod

 Bloc

7. What is hot reload in Flutter?


Hot reload allows developers to see changes in the app without restarting it, speeding up development.
8. How do you handle async operations in Flutter?
Using async/await, Futures, and Streams.
9. What is the purpose of [Link]?
It's the configuration file for Flutter projects, managing dependencies and assets.
10. How do you navigate between screens in Flutter?
Using Navigator and Routes.
11. What is the difference between null and undefined in Dart?
 Null means a variable has no value.
 Undefined means a variable is not declared.

12. How do you handle errors in Flutter?


Using try-catch blocks and error handling mechanisms like ErrorWidget.
13. What is a Future in Dart?
A Future represents a value that will be available in the future, used for async operations.
14. How do you make a network request in Flutter?
Using packages like http or dio.
15. What is the purpose of WidgetsApp?
It's a basic widget that provides a set of common functionality for apps.
16. How do you style widgets in Flutter?
Using properties like color, fontSize, and padding, or wrapping widgets with Theme or DecoratedBox.
17. What is the difference between Column and Row?
 Column stacks widgets vertically.
 Row stacks widgets horizontally.
18. How do you handle platform-specific code in Flutter?
Using platform channels or packages like platform_channel.
19. What is a Stream in Dart?
A Stream is a sequence of asynchronous events.
20. How do you optimize Flutter app performance?
Using techniques like const widgets, reducing widget rebuilds, and optimizing images.
21. What is the purpose of the build() method?
It's called when the widget needs to be rebuilt.
22. How do you handle user input in Flutter?
Using widgets like TextField, Checkbox, and GestureDetector.
23. What is the difference between Padding and Margin?
 Padding is the space inside a widget.
 Margin is the space outside a widget.

24. How do you use animations in Flutter?


Using AnimationController, Tween, and AnimatedBuilder.
25. What is the purpose of the initState() method?
It's called when the widget is inserted into the tree.
26. How do you handle dependencies in Flutter?
Using [Link] and packages like [Link].
27. What is the difference between Scaffold and Container?
 Scaffold provides a basic app structure.
 Container is a basic layout widget.

28. How do you handle localization in Flutter?


Using packages like Intl or i18n.
29. What is the purpose of the dispose() method?
It's called when the widget is removed from the tree.
30. How do you use Firebase in Flutter?
Using packages like firebase_core and firebase_auth.
31. What is the difference between ListView and GridView?
 ListView displays items in a scrollable list.
 GridView displays items in a grid.

32. How do you handle gestures in Flutter?


Using widgets like GestureDetector and InkWell.
33. What is the purpose of the main() function?
It's the entry point of the app.
34. How do you use themes in Flutter?
Using ThemeData and wrapping widgets with Theme.
35. What is the difference between StatelessWidget and StatefulWidget?
 StatelessWidget is immutable.
 StatefulWidget can change state.

36. How do you handle errors in async operations?


Using try-catch blocks and error handling mechanisms.
37. What is the purpose of the Navigator?
It's used for navigating between screens.
38. How do you use shared preferences in Flutter?
Using packages like shared_preferences.
39. What is the difference between null safety and nullable types?
 Null safety prevents null pointer exceptions.
 Nullable types allow variables to be null.

40. How do you optimize images in Flutter?


Using packages like [Link] and caching.
41. What is the purpose of the Provider package?
It's used for state management.
42. How do you handle platform-specific UI?
Using platform channels or packages like platform_ui.
43. What is the difference between build and constructor?
 build is called when the widget needs to be rebuilt.
 constructor is called when the widget is created.

44. How do you use lists in Flutter?


Using ListView, GridView, or ListTile.
45. What is the purpose of the Expanded widget?
It's used to expand a child widget.
46. How do you handle deep linking in Flutter?
Using packages like uni_links.
47. What is the difference between async and sync?
 async operations are non-blocking.
 sync operations are blocking.

48. How do you use maps in Flutter?


Using Map data structure.
49. What is the purpose of the StreamBuilder?
It's used to build widgets from streams.
50. How do you handle testing in Flutter?
Using packages like flutter_test and test.

You might also like