【问题标题】:Text field starting with fixed maxLines and growing as user types以固定 maxLines 开头并随着用户类型增长的文本字段
【发布时间】:2019-03-04 02:27:20
【问题描述】:

我想创建一个以 5 个空行开头的文本字段,当用户键入超过 5 行时会增加。

我已经有了这个代码:

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

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

提前致谢!

【问题讨论】:

标签: dart flutter textfield


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-12-30
    • 1970-01-01
    • 2012-12-13
    • 2018-08-13
    • 1970-01-01
    • 1970-01-01
    • 2013-12-18
    • 2021-12-24
    • 1970-01-01
    相关资源
    最近更新 更多