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?
Flutter is primarily used for: a. Backend development b. Cross-platform UI development c. Cloud infrastructure d. Database management
Which company developed Flutter? a. Apple b. Microsoft c. Google d. Facebook
Flutter is written in which programming language? a. Kotlin b. Dart c. Swift d. Java
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
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
To install Flutter, which of the following is mandatory? a. Python b. Java JDK c. Git d. Apache Server
What command is used to verify the Flutter installation? a. flutter doctor b. flutter setup c. dart check d. flutter install
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++
When setting up Flutter, which environment variable must be configured? a. JAVA_HOME b. FLUTTER_HOME c. PATH d. PYTHON_PATH
What tool does Flutter use to manage dependencies? a. Maven b. Gradle c. pubspec.yaml d. package.json
Topic: Flutter Architecture
Flutter’s core architecture is based on: a. Model-View-Controller (MVC) b. Reactive programming c. Object-Oriented Programming (OOP) d. Event-driven programming
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
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.
The Flutter engine is written in: a. Dart b. C++ c. Java d. Python
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
Dart is primarily used for: a. Web design b. Mobile app development c. Backend scripting d. Game development
In Dart, which keyword is used to declare a constant value? a. final b. const c. static d. var
What is the default data type in Dart? a. int b. dynamic c. String d. Object
Which syntax is correct for defining a Dart function? a. func myFunction() {} b. void myFunction() {} c. def myFunction() {} d. function myFunction() {}
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
Which of the following is a valid Dart loop? a. foreach loop b. do-while loop c. foreach-do loop d. while-for loop
What is the correct syntax for an if statement in Dart? a. if condition {} b. if (condition) {} c. if {condition} d. if: condition {}
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
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++) {}
Which keyword is used to exit a loop in Dart? a. stop b. quit c. exit d. break
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
In Dart, the ternary operator syntax is: a. condition ? expr1 : expr2 b. condition : expr1 ? expr2 c. expr1 ? condition : expr2 d. expr1 : condition ? expr2
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) {}
Dart’s assert statement is primarily used for: a. Debugging purposes b. Loop control c. Error handling d. Logging messages
What keyword is used in Dart to handle exceptions? a. catch b. error c. try d. handle