How to change TextField's height and width?

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

How to customise TextField\'s width and height?

7条回答
  •  萌比男神i
    2020-12-13 08:50

    Screenshot:


    Widget _buildTextField() {
      final maxLines = 5;
    
      return Container(
        margin: EdgeInsets.all(12),
        height: maxLines * 24.0,
        child: TextField(
          maxLines: maxLines,
          decoration: InputDecoration(
            hintText: "Enter a message",
            fillColor: Colors.grey[300],
            filled: true,
          ),
        ),
      );
    }
    

提交回复
热议问题