Is there a way to dynamically change the Flutter TextField's maxLines?

前端 未结 2 674

I have a TextField like this:

new Flexible(
    fit: FlexFit.loose,
    child: new Container(
        alignment: FractionalOffset.topLeft,
        child: new         


        
2条回答
  •  青春惊慌失措
    2020-12-31 03:32

    its look like a text-area. you can try with maxLines

    maxLines: 8

    TextField(
            maxLines: 8,
            decoration: InputDecoration(hintText: "Enter your text here", border: OutlineInputBorder(),
            labelText: 'Post Body'),
        ),
    

提交回复
热议问题