My app will be used for different devices and different screen sizes and a well coded app should shown same at different screen sizes. Flutter has MediaQuery.of(context).size property. I wanna give a padding value to Padding widget like "padding: EdgeInsets.only(top: _height/3)" but it is not acceptable. Just static values has accept for padding. How to write a dynamic value to padding?
I tried to determine that "var _paddingTop = _height/3" at initState and still it isn't acceptable.
Padding(
padding: EdgeInsets.only(top: _height/4),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// some widgets
],
),
),
just remove the const
Padding(
padding: EdgeInsets.only(top: _height/4),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// some widgets
],
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With