0

Ideally, I'd like to do this

SizedBox(
    height: 20.0,
    width: 25%,
),

instead of

SizedBox(
    height: 20.0,
    width: 150.0,
),

Thanks! Super new to Flutter, appreciate the guidance!

1 Answers1

2

Try this:

MediaQuery.of(context).size.width * 0.25;

It gets the width of the device and multiplies it by 0.25 for that 25% you are looking for. Hope it helps!

Benedikt J Schlegel
  • 1,707
  • 1
  • 10
  • 23