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

junior

When should you use WidgetsBindingObserver ?

middle

Explain the different types of Streams?

senior

Why should you use kReleaseMode instead of assert ?

Bình luận

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

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