Google Flutter Basics 1 — Questions and Answers
Question 1: Flutter's initial alpha version was released in _____.
- May 2019
- May 2016
- May 2018
- May 2017 (Correct answer)
Correct answer: May 2017
Flutter's initial alpha version was publicly released in May 2017 at the Google I/O conference. This marked the beginning of its journey as a prominent cross-platform UI toolkit, eventually leading to its stable 1.0 release in December 2018.
Question 2: Dart is _____.
- Dart is a programming language used to construct front-end user interfaces.
- Dart is a computer language that is object-oriented.
- Both are correct (Correct answer)
- None of the above
Correct answer: Both are correct
Dart is both a programming language primarily used to construct front-end user interfaces, especially with Flutter, and an object-oriented language. Its object-oriented nature means it supports concepts like classes, objects, inheritance, and polymorphism, which are fundamental to its structure and usage in application development.
Question 3: We can't write a Flutter application without the main() function.
- True (Correct answer)
- False
Correct answer: True
This statement is true. Like many programming languages, Dart (and thus Flutter) requires a `main()` function as the entry point for the application. Execution begins from this function, which typically calls `runApp()` to initialize and start the Flutter UI framework.
Question 4: A _____ is an asynchronous sequence of events.
- Sequence
- Stream (Correct answer)
- Current
- Flow
Correct answer: Stream
In Dart and Flutter, a `Stream` represents a sequence of asynchronous events. It's a powerful mechanism for handling data that arrives over time, such as user input, network responses, or file reads, allowing you to listen and react to each event as it occurs.
Question 5: The _____ operator evaluates and returns the value of two expressions.
- &&
- ?? (Correct answer)
- &
- ?
Correct answer: ??
The `??` operator in Dart is the null-aware coalescing operator. It evaluates the expression on its left-hand side; if that expression is non-null, its value is returned. Otherwise, it evaluates and returns the value of the expression on its right-hand side, providing a concise way to provide a default value for potentially null expressions.
Question 6: How many different kinds of widgets are there in Flutter?
- 1
- 2 (Correct answer)
- 3
- 4
Correct answer: 2
In Flutter, there are two fundamental kinds of widgets: `StatelessWidget` and `StatefulWidget`. `StatelessWidget`s are immutable and do not change over time, while `StatefulWidget`s can maintain mutable state that changes during the lifetime of the widget, allowing for dynamic and interactive UIs.
Question 7: While compiling the application, the Flutter tooling provides _____ modes.
- 1
- 2
- 3 (Correct answer)
- 4
Correct answer: 3
Flutter tooling provides three main compilation modes: `debug`, `profile`, and `release`. The `debug` mode is optimized for fast development with features like hot reload, `profile` mode is used for performance analysis, and `release` mode is fully optimized for deployment, with no debugging information and minimal overhead.
Flutter's initial alpha version was released in _____.