I have created a list view , containging 3 TextFields , the problem is that ofc , they expand through the all screen width.
I tried , wrapping them with a container and set a width , and wrap it with a LimitedBox and set maxWidth - Neither of them works How i can control the width of the Textfields the inside the Listview , or please an alternative way to accomplish it. I have added one of the Textfields with my tries of resizing its width Thanks
ListView(
children: <Widget>[
LimitedBox(
maxWidth: 50,
child: Container(
width: 50,
child: TextFormField(
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
hintText: '[email protected]',
hintStyle: TextStyle(fontSize: 10, color: Colors.white),
labelText: 'E-mail adress',
labelStyle: TextStyle(
color: Colors.white,
)),
),
),
),
),
use Row Widget
ListView(children: <Widget>[
Row(
children: <Widget>[
LimitedBox(
maxWidth: 50,
child: Container(
child: TextFormField(
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
hintText: '[email protected]',
hintStyle: TextStyle(fontSize: 10, color: Colors.white),
labelText: 'E-mail adress',
labelStyle: TextStyle(
color: Colors.white,
)),
),color: Colors.amber,
),
)
],
),
])
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