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

前端 未结 2 665

I have a TextField like this:

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


        
2条回答
  •  天涯浪人
    2020-12-31 03:34

    Flutter was lagging multiline support in TextField. After an issue was raised regarding the same, the multiline feature has been added in the 0.0.16 release.

    Make sure you upgrade flutter to the latest release. To get multiline TextField use:

    new TextField(
        maxLines: null,
        keyboardType: TextInputType.multiline,
    ) 
    

    Hope this helped!

提交回复
热议问题