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

What is the difference between Expanded and Flexible widgets?

Câu trả lời

The main differences between the Expanded and Flexible widgets in Flutter are:

  1. Expanded always takes up all the available space along the main axis (width for Row, height for Column), while Flexible only takes up the space it needs[1][2][3].

  2. Expanded is a subclass of Flexible with fit: FlexFit.tight by default, which means it forces its child to fill the available space[1][4]. Flexible has fit: FlexFit.loose by default, allowing its child to be smaller than the available space.

  3. Expanded has a flex property that determines how the available space is distributed between multiple Expanded widgets. Flexible also has a flex property to control space distribution, but it's more flexible in how it sizes its child[2][4].

  4. Flexible gives you more control over how the child widget fills the available space via t...

junior

junior

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

junior

Does Flutter work like a browser? How is it different from a WebView based application?

entry

What is Flutter?

senior

When would you use App state or Ephemeral state over another?

Bình luận

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

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