WorksheetsQuiz 2 6/8/2025
Total questions: 20
Worksheet time: 3mins
Which of the following best describes a function in Dart?
a) A variable that stores a string
b) A loop used for iteration
c) A block of code that performs a specific task
d) A built-in data type in Dart
In Dart, what are 10 and 20 called in the following function call?
add(10, 20);
a) Parameters
b) Arguments
c) Variables
d) Return values
What is the syntax of an anonymous function in Dart?
a) function() => {}
b) function() => expression;
c ) () { /* code */ }
d) { function() }
What will happen if you pass positional parameters in the wrong order in Dart?
a) It may produce wrong results
b) It gives a syntax error
c) Dart automatically reorders them
d) The program crashes
What is the purpose of the super keyword in Dart?
a) To initialize default values
b) To create a new instance of a class
c) To access properties and methods of a parent class
d) To define private methods
What type of inheritance is NOT supported in Dart?
a) Multiple Inheritance
b) Multilevel Inheritance
c) Hierarchical Inheritance
d) Single Inheritance
Which of the following is TRUE about constructors in Dart?
a) Constructor names must be different from class names
b) Constructors return a string by default
c) Dart does not support constructors
d) Constructors are automatically called when an object is created
Which of the following best defines polymorphism in Dart?
a) Using the same variable across different programs
b) The ability of an object to take on many forms
c) Assigning multiple values to a single variable
d) The ability to write multiple main() methods
What widget acts as the base layout structure in most Flutter apps?
a) Scaffold
b) Text
c) Column
d) MaterialApp
What kind of UI design systems does Flutter support?
a) WPF and Electron
b) HTML5 & Bootstrap
c) Material Design and Cupertino
d) Windows Forms & GTK
Which tool is recommended to install Flutter SDK on Ubuntu via terminal?
a) apt-get
b) brew
c) snap
d) yum
Which file in a Flutter project defines dependencies and app metadata?
a) main.dart
b) pubspec.yaml
c) build.gradle
d) manifest.json
What command is used to create a new Flutter project?
a) flutter start myapp
b) flutter create myapp
c) flutter init
d) flutter run myapp
What is a widget in Flutter?
a) A backend service
b) A plugin for Android
c) An immutable description of a part of the user interface
d) A build script for Flutter apps
Which of the following widgets maintains state in Flutter?
a) Text
b) StatefulWidget
c) Column
d) StatelessWidget
What does the floatingActionButton in Scaffold represent?
a) A drawer icon
b) circular button floating above content for primary action
c) A loading spinner
d) An elevated menu
Which of the following is an example of a StatelessWidget?
a) Checkbox
b) Text
c) Slider
d) TextField
Which Scaffold property displays content below the AppBar and above the FloatingActionButton?
a) drawer
b) bottomNavigationBar
c) body
d) persistentFooterButtons
What is the default position of the floatingActionButton in a Scaffold?
a) Top right
b) Bottom left
c) Center bottom
d ) Bottom right
Which Flutter button is a flat button with no elevation and no border by default?
a) TextButton
b) ElevatedButton
c) OutlinedButton
d) IconButton
