【发布时间】:2022-01-11 15:02:37
【问题描述】:
我有一个 maxLength 设置为 150 的文本字段。但是,我希望 textField 的 maxLine 属性在按 Enter 时增加 1。请问我怎样才能做到这一点?
在下面找到我的代码:
child: Padding(
padding: const EdgeInsets.all(20.0),
child: TextField(
maxLines: 5,
maxLength: 150,
controller: _userAboutController,
decoration: InputDecoration(
helperText: '(Optional)',
labelText: user.about,
icon: Image.asset(
"Assets/images/country.png",
height: 40.0,
),
focusedBorder: UnderlineInputBorder(
borderSide:
BorderSide(color: secondaryColor, width: 2.0),
),
),
),
),
【问题讨论】: