Flutter数字键盘与'完成'为iOS

m4pnthwp  于 2023-04-13  发布在  Flutter
关注(0)|答案(1)|浏览(141)
TextFormField(
 key: Key(keyValue),
 initialValue: valueBuilder,
 onSaved: (text) {
        
 },
 inputFormatters: [inputFormatters],
 keyboardType: TextInputType.number,)

我也试过
键盘类型:文本输入类型.编号带选项(带符号:true,decimal:真)
但也不管用。

luaexgnf

luaexgnf1#

您只需要添加以下行,它将为您工作

TextFormField(
    .....
    keyboardType: TextInputType.numberWithOptions(signed: true, decimal: true), // OR keyboardType: TextInputType.number,
    textInputAction: TextInputAction.done,
)

相关问题