
fLUTTER_LAB2
Authored by Mahnoor Mahnoor
Information Technology (IT)
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary difference between a stateful and a stateless widget in Flutter?
Answer explanation
A stateful widget is dynamic and can change its appearance in response to user interactions or data changes
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which Flutter widget is an example of a stateless widget?
Answer explanation
Icon is a stateless widget because it does not change its appearance once built
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the setState() method do in a stateful widget?
Answer explanation
Calling setState() notifies the Flutter framework that the widget's state has changed
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a required class when implementing a custom stateful widget?
Answer explanation
A custom stateful widget requires a subclass of StatefulWidget to define the widget and a subclass of State to manage its state.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the build() method in the State class?
Answer explanation
The build() method in the State class defines the widget's user interface by returning a widget tree.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which property of ElevatedButton is used to handle a tap event?
Answer explanation
The onPressed property of ElevatedButton defines the callback function that handles tap events.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which widget is used to control a TextField in the stateful widget example with a text field?
Answer explanation
TextEditingController is used to control the TextField
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?