Bhavya Budhia
Bhavya Budhia

Reputation: 160

Controlling element sizes depending on screen size

Is there any way in flutter in which we can size everything in our app depending on screen size like rem property in css. Because all widgets demand sizes in pixel sizes which can be different for different screen size.

Upvotes: 0

Views: 1755

Answers (2)

Sunny S
Sunny S

Reputation: 13

did you find answer to this question? I have been searching about it too

Upvotes: 0

scrimau
scrimau

Reputation: 1385

Because all widgets demand sizes in pixel sizes

Actually, flutter uses density independent pixels (dp) for width/height arguments. dp actually scale with resolution, meaning 1 dp is displayed as the same PHYSICAL distance on every device.

But for relative layout there are some options:

  1. Flexible
  2. Expanded
  3. MediaQuery
  4. LayoutBuilder
  5. GridView
  6. other layout options

Upvotes: 3

Related Questions