Logo
search
menuicon
thubnail
Bilik darjah
Ikut Turutan
Lain
Sains

Stateless vs Statefull Widgets

Rehman Ullah K
0
Masalah tambahan (10/ 20)
Allow incorrect answer
Tunjukkan jawapan
public kuiz

Bahan pembelajaran

Fail

Stateless-vs-Stateful-Widgets-in-Flutter.pdf
Benarkan lihat semasa menjawab

masalah 1

pilihan

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

masalah 2

pilihan

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

masalah 3

pilihan

What method do you override to create the UI in a StatelessWidget?

  • build()
  • setState()
  • createState()
  • initState()

masalah 4

pilihan

Which method is used in a StatefulWidget to update the UI based on state changes?

  • build()
  • setState()
  • createState()
  • dispose()

masalah 5

pilihan

What is a benefit of using stateless widgets?

  • Complex implementation
  • Better performance for static content
  • Requires managing state
  • Rebuilds frequently

masalah 6

pilihan

What are the two classes involved in implementing a StatefulWidget?

  • Widget and State
  • StatelessWidget and StatefulWidget
  • State and ImmutableState
  • Widget and BuildContext

masalah 7

pilihan

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

masalah 8

pilihan

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

masalah 9

pilihan

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

masalah 10

pilihan

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