Logo
교실
quiz thumbnail
Ikut Turutan
Lain
Sains

Stateless vs Statefull Widgets

Rehman Ullah K

0

10 soalan

Allow incorrect answer

Tunjuk jawapan bila salah

public kuiz

Bahan pembelajaran

Fail
Paparan dibenarkan semasa kuiz
Stateless-vs-Stateful-Widgets-in-Flutter.pdf
# 1pilihan
What is a key characteristic of stateless widgets in Flutter?
They maintain their own state
They are immutable
They require a State class
They rebuild when state changes
# 2pilihan
In which scenario should you use a stateful widget?
When displaying static text
When data is managed by its parent
When the UI needs to change dynamically
When displaying a non-interactive image
# 3pilihan
What method do you override to create the UI in a StatelessWidget?
build()
setState()
createState()
initState()
# 4pilihan
Which method is used in a StatefulWidget to update the UI based on state changes?
build()
setState()
createState()
dispose()
# 5pilihan
What is a benefit of using stateless widgets?
Complex implementation
Better performance for static content
Requires managing state
Rebuilds frequently
# 6pilihan
What are the two classes involved in implementing a StatefulWidget?
Widget and State
StatelessWidget and StatefulWidget
State and ImmutableState
Widget and BuildContext
# 7pilihan
How does a StatelessWidget handle updates when data changes?
It updates only the changed state
It rebuilds completely
It uses setState()
It does not update
# 8pilihan
Which of the following is not a use case for a stateless widget?
Displaying a fixed icon
Showing a constant text
Handling a dynamic list
Displaying a non-interactive image
# 9pilihan
When should you choose a stateless widget over a stateful widget?
When the UI needs to change dynamically
When internal state management is needed
When performance optimization is important
When handling user interactions
# 10pilihan
What is the role of the State class in a StatefulWidget?
To render UI elements
To manage mutable state
To implement the build method
To dispose of the widget
Google Classroom Share

Kuiz ini dicipta guna peta premium. Akses disekat kerana pelan tamat tempoh.