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

senior

What's the difference between async and async* in Dart?

middle

Differentiate StatelessWidget and StatefulWidget ?

middle

What is release mode and when do you use it?

Bình luận

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

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