flutter textfield

释放光标

FocusScope.of(context).unfocus()

输入类型

keyboardType: TextInputType.number,

键盘右下角按键类型

textInputAction: TextInputAction.done,

光标颜色

cursorColor: Colors.orange,

去掉下划线

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

输入限制

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

猜你喜欢

转载自www.cnblogs.com/qqcc1388/p/11578094.html