释放光标 关闭键盘

FocusScope.of(context).unfocus()
//推荐使用下面这种方式
FocusManager.instance.primaryFocus?.unfocus();

输入类型

keyboardType: TextInputType.number,

键盘右下角按键类型

textInputAction: TextInputAction.done,

光标颜色

cursorColor: Colors.orange,

去掉下划线

decoration: InputDecoration(
    hintText: '请输入验证码',  //placeholder
    border: InputBorder.none, //隐藏下划线
),

输入限制

inputFormatters: [
     LengthLimitingTextInputFormatter(11)  //最多允许输入11位
    ],

多行显示

keyboardType: TextInputType.multiline,

设置高度

 maxLines: 100,

内容居中 微调contentPadding值即可

 contentPadding: 

输入框抵住键盘 内容不随键盘滚动

return Scaffold(
  appBar: AppBar(
    title: new Text("dff"),
  ),
    resizeToAvoidBottomPadding: false, //输入框抵住键盘 内容不随键盘滚动
);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-01-21
  • 2022-12-23
  • 2021-05-31
  • 2021-09-20
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2021-08-11
  • 2021-09-07
  • 2022-01-13
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案