Flutter Quiz

Flutter is Google’s toolkit for building mobile, web and desktop apps from a single Dart codebase. The questions cover widgets, stateless and stateful widgets, layouts, navigation and the basics of Dart.

What this quiz covers

Study tip: Remember that almost everything in Flutter is a widget; thinking in widget trees makes layout questions easy.

Questions, answers and explanations

1. What is Flutter?

  1. A Programming Language
  2. A UI Toolkit
  3. A Database
  4. A Web Browser

Answer: A UI Toolkit

Flutter is Google's open-source UI toolkit for building cross-platform applications.

2. Who developed Flutter?

  1. Microsoft
  2. Facebook
  3. Google
  4. Oracle

Answer: Google

Flutter is developed and maintained by Google.

3. Which programming language is used by Flutter?

  1. Java
  2. Dart
  3. Kotlin
  4. Swift

Answer: Dart

Flutter applications are written using the Dart programming language.

4. Which widget is the root widget of most Flutter apps?

  1. MaterialApp
  2. Scaffold
  3. Container
  4. Column

Answer: MaterialApp

MaterialApp is commonly used as the root widget in Flutter applications.

5. Which command creates a new Flutter project?

  1. flutter create
  2. flutter new
  3. flutter init
  4. create flutter

Answer: flutter create

The 'flutter create' command creates a new Flutter project.

6. Which widget is used to arrange children vertically?

  1. Column
  2. Row
  3. Stack
  4. Container

Answer: Column

The Column widget arranges its children vertically.

7. Which widget is used to arrange children horizontally?

  1. Row
  2. Column
  3. Stack
  4. Expanded

Answer: Row

The Row widget arranges its children horizontally.

8. Which widget provides the basic Material Design visual layout structure?

  1. Scaffold
  2. Container
  3. Card
  4. AppBar

Answer: Scaffold

Scaffold provides the basic visual layout structure for Material apps.

9. Which command runs a Flutter application?

  1. flutter run
  2. flutter start
  3. flutter launch
  4. flutter execute

Answer: flutter run

The 'flutter run' command builds and runs a Flutter application.

10. Flutter is mainly used for developing?

  1. Cross-platform Apps
  2. Operating Systems
  3. Databases
  4. Games Only

Answer: Cross-platform Apps

Flutter allows developers to build Android, iOS, Web, Windows, macOS, and Linux apps from one codebase.

11. Which widget is used to display text in Flutter?

  1. Text
  2. Label
  3. Paragraph
  4. Typography

Answer: Text

The Text widget is used to display text on the screen.

12. Which widget is used to display an image?

  1. Image
  2. Picture
  3. Photo
  4. Icon

Answer: Image

The Image widget displays images from assets, files, or the network.

13. Which widget is used to create a clickable button?

  1. ElevatedButton
  2. ButtonView
  3. ClickButton
  4. PressButton

Answer: ElevatedButton

ElevatedButton is the standard Material button in Flutter.

14. Which widget allows scrolling when content exceeds the screen size?

  1. ListView
  2. Column
  3. Container
  4. Expanded

Answer: ListView

ListView provides a scrollable list of widgets.

15. Which method is called when a StatefulWidget is first created?

  1. initState()
  2. build()
  3. dispose()
  4. start()

Answer: initState()

initState() is called once when the State object is created.

16. Which method rebuilds the UI after state changes?

  1. setState()
  2. updateState()
  3. refresh()
  4. rebuild()

Answer: setState()

Calling setState() tells Flutter to rebuild the widget.

17. Which widget is used to add padding around another widget?

  1. Padding
  2. Margin
  3. Space
  4. Container

Answer: Padding

The Padding widget adds empty space around its child.

18. Which widget stacks children on top of each other?

  1. Stack
  2. Column
  3. Row
  4. ListView

Answer: Stack

The Stack widget overlays its children.

19. Which file contains the dependencies of a Flutter project?

  1. pubspec.yaml
  2. flutter.json
  3. package.json
  4. config.yaml

Answer: pubspec.yaml

The pubspec.yaml file manages packages and project settings.

20. What is one major advantage of Flutter?

  1. Single Codebase for Multiple Platforms
  2. Fast UI Rendering
  3. Hot Reload
  4. All of the above

Answer: All of the above

Flutter provides Hot Reload, fast rendering, and one codebase for Android, iOS, Web, Windows, macOS, and Linux.

Take the timed quiz