gpt4 book ai didi

dart - 以固定的 maxLines 开始并随着用户类型增长的文本字段

转载 作者:IT王子 更新时间:2023-10-29 07:06:04 25 4
gpt4 key购买 nike

我想制作一个以 5 行空行开头的文本字段,当用户键入超过 5 行时,它会增长。

我已经有了这个代码:

new Container(
margin: EdgeInsets.all(10.0),
child: TextFormField(
maxLines: null,
keyboardType: TextInputType.multiline,
decoration: InputDecoration(labelText: 'Enter description'),
controller: descriptionController,
)
)

但现在我希望文本字段以 5 行开头。

提前致谢!

最佳答案

目前看来不可能。这绝对是一件好事。 minLines 功能请求已提交给开发人员并正在考虑中。 https://github.com/flutter/flutter/issues/20957

关于dart - 以固定的 maxLines 开始并随着用户类型增长的文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52549418/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com