Câu hỏi phỏng vấn Flutter
Câu hỏi

Differentiate StatelessWidget and StatefulWidget ?

Câu trả lời

Here is a concise answer differentiating StatelessWidget and StatefulWidget in Flutter:

StatelessWidgets are immutable - their properties and state cannot change after creation. They are useful for parts of the UI that do not depend on any changes. Examples include Text, Icon, and IconButton[1][2][3].

StatefulWidgets are dynamic - they can change their appearance in response to user interactions or when receiving data. They are useful for parts of the UI that can change over time. Examples include Checkbox, Radio, Slider, InkWell, Form, and TextField[1][2][3].

The key differences are:

  • StatelessWidgets are immutable, StatefulWidgets are dynamic and can change state
  • StatelessWidgets override the build() method, StatefulWidgets override createState() which returns a State object
  • S...
middle

middle

Gợi ý câu hỏi phỏng vấn

senior

What is a MediaQuery in Flutter and when do we use it?

middle

Differentiate between required and optional parameters in Dart

middle

Explain Navigator Widget and its push/pop functions in Flutter?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào