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

What is a MediaQuery in Flu...

Câu trả lời

A MediaQuery in Flutter is a powerful tool that allows developers to create responsive user interfaces by providing information about the current device's screen size, orientation, and other layout preferences[1][2][3].

We use MediaQuery in Flutter when we need to:

  1. Adapt the UI layout based on the device's screen size and orientation[1][2][3]. For example, we can use MediaQuery to change the size of images, fonts, or layout elements based on the device's width or height.

  2. Determine the device's orientation (portrait or landscape) and rebuild the UI accordingly[2][3].

  3. Check if the user has modified the default font size and adjust the UI accordingly[3].

  4. Determine if parts of the screen are obscured by a system UI, similar to using a safe area widget[3].

  5. Access other device-specific information such as device pixel ratio, platform brightness (light/dark mode), and more[1][2][3].

To access MediaQuery prop...

senior

senior

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

middle

What is ScopedModel / BLoC Pattern?

middle

Differentiate between required and optional parameters in Dart

senior

What are the similarities and differences of Future and Stream?

Bình luận

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

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