MCQs on Introduction to Flutter & Dart Basics | Flutter Basics MCQs Question and Answer

Explore Flutter MCQ questions and answers to boost your understanding of this powerful UI toolkit and its foundational programming language, Dart. Flutter enables seamless cross-platform development with a single codebase. Learn about Flutter’s setup, architecture, and Dart basics, including syntax, variables, data types, and control structures, through these essential MCQs.


MCQs: Chapter – Introduction to Flutter & Dart Basics

Topic: What is Flutter?

  1. Flutter is primarily used for:
    a. Backend development
    b. Cross-platform UI development
    c. Cloud infrastructure
    d. Database management
  2. Which company developed Flutter?
    a. Apple
    b. Microsoft
    c. Google
    d. Facebook
  3. Flutter is written in which programming language?
    a. Kotlin
    b. Dart
    c. Swift
    d. Java
  4. What is the main advantage of using Flutter?
    a. Supports only Android apps
    b. Separate codebases for each platform
    c. Single codebase for multiple platforms
    d. Complex integration with APIs
  5. Which of the following is NOT true about Flutter?
    a. It uses a declarative UI approach.
    b. It supports hot reload.
    c. It is limited to mobile apps only.
    d. It provides a rich set of widgets.

Topic: Setting up Flutter Environment

  1. To install Flutter, which of the following is mandatory?
    a. Python
    b. Java JDK
    c. Git
    d. Apache Server
  2. What command is used to verify the Flutter installation?
    a. flutter doctor
    b. flutter setup
    c. dart check
    d. flutter install
  3. Which IDEs are commonly used with Flutter?
    a. Eclipse and NetBeans
    b. IntelliJ IDEA and Visual Studio Code
    c. BlueJ and PyCharm
    d. Atom and Notepad++
  4. When setting up Flutter, which environment variable must be configured?
    a. JAVA_HOME
    b. FLUTTER_HOME
    c. PATH
    d. PYTHON_PATH
  5. What tool does Flutter use to manage dependencies?
    a. Maven
    b. Gradle
    c. pubspec.yaml
    d. package.json

Topic: Flutter Architecture

  1. Flutter’s core architecture is based on:
    a. Model-View-Controller (MVC)
    b. Reactive programming
    c. Object-Oriented Programming (OOP)
    d. Event-driven programming
  2. The Flutter framework consists of:
    a. Foundation library, Widgets, and Engine
    b. Widgets, Middleware, and Database
    c. Controllers, Models, and Views
    d. Database, Network, and UI layers
  3. What role do widgets play in Flutter?
    a. They manage backend services.
    b. They represent UI components.
    c. They handle database interactions.
    d. They define routing logic.
  4. The Flutter engine is written in:
    a. Dart
    b. C++
    c. Java
    d. Python
  5. Flutter’s widget tree is:
    a. Hierarchical and immutable
    b. Dynamic and flat
    c. Based on MVC principles
    d. Non-reactive

Topic: Dart Language Basics

  1. Dart is primarily used for:
    a. Web design
    b. Mobile app development
    c. Backend scripting
    d. Game development
  2. In Dart, which keyword is used to declare a constant value?
    a. final
    b. const
    c. static
    d. var
  3. What is the default data type in Dart?
    a. int
    b. dynamic
    c. String
    d. Object
  4. Which syntax is correct for defining a Dart function?
    a. func myFunction() {}
    b. void myFunction() {}
    c. def myFunction() {}
    d. function myFunction() {}
  5. In Dart, a variable declared with final can be:
    a. Changed later
    b. Initialized multiple times
    c. Initialized only once
    d. Used without initialization

Topic: Dart Control Structures

  1. Which of the following is a valid Dart loop?
    a. foreach loop
    b. do-while loop
    c. foreach-do loop
    d. while-for loop
  2. What is the correct syntax for an if statement in Dart?
    a. if condition {}
    b. if (condition) {}
    c. if {condition}
    d. if: condition {}
  3. The switch statement in Dart:
    a. Supports only integer values
    b. Requires a break after each case
    c. Does not need a default case
    d. Can use string values as case expressions
  4. How do you write a Dart for loop?
    a. for (var i = 0; i < 10; i++) {}
    b. for i in range(10): {}
    c. for (int i to 10) {}
    d. for (i = 0; i < 10; i++) {}
  5. Which keyword is used to exit a loop in Dart?
    a. stop
    b. quit
    c. exit
    d. break
  6. What does the continue keyword do in a Dart loop?
    a. Exits the loop
    b. Skips to the next iteration
    c. Repeats the current iteration
    d. Stops the loop entirely
  7. In Dart, the ternary operator syntax is:
    a. condition ? expr1 : expr2
    b. condition : expr1 ? expr2
    c. expr1 ? condition : expr2
    d. expr1 : condition ? expr2
  8. Which is a valid example of a while loop in Dart?
    a. while i < 10 {}
    b. while (i < 10) {}
    c. while {i < 10} {}
    d. while (i: 10) {}
  9. Dart’s assert statement is primarily used for:
    a. Debugging purposes
    b. Loop control
    c. Error handling
    d. Logging messages
  10. What keyword is used in Dart to handle exceptions?
    a. catch
    b. error
    c. try
    d. handle

Answer Key

QNoAnswer
1b. Cross-platform UI development
2c. Google
3b. Dart
4c. Single codebase for multiple platforms
5c. It is limited to mobile apps only.
6c. Git
7a. flutter doctor
8b. IntelliJ IDEA and Visual Studio Code
9c. PATH
10c. pubspec.yaml
11b. Reactive programming
12a. Foundation library, Widgets, and Engine
13b. They represent UI components.
14b. C++
15a. Hierarchical and immutable
16b. Mobile app development
17b. const
18b. dynamic
19b. void myFunction() {}
20c. Initialized only once
21b. do-while loop
22b. if (condition) {}
23d. Can use string values as case expressions
24a. for (var i = 0; i < 10; i++) {}
25d. break
26b. Skips to the next iteration
27a. condition ? expr1 : expr2
28b. while (i < 10) {}
29a. Debugging purposes
30c. try

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top