How to change TextField's height and width?

后端 未结 7 1673
既然无缘
既然无缘 2020-12-13 08:02

How to customise TextField\'s width and height?

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 08:54

    You can try the margin property in the Container. Wrap the TextField inside a Container and adjust the margin property.

    new Container(
      margin: const EdgeInsets.only(right: 10, left: 10),
      child: new TextField( 
        decoration: new InputDecoration(
          hintText: 'username',
          icon: new Icon(Icons.person)),
      )
    ),
    

提交回复
热议问题