在iOS设备上使用TextInputType.number时,我遇到了键盘上缺少"."(小数点)字符的问题.我已经正确地设置了输入格式化程序,只允许数字和".性格,但仍然是"."键盘上看不到字符.以下是我的代码片段:
Container(
width: 65.w,
height: 6.w,
child: TextFormField(
// The validator receives the text that the user has entered.
controller:
_currentWeightController,
textAlign: TextAlign.left,
keyboardType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter
.allow(RegExp('[0-9.]')),
],
style: TextStyle(
fontSize: 20,
color: Colors.black),
// decoration: InputDecoration(
// hintText:
// '${num.parse(measurementRes[targetWeight] ?? "0").ceil().toString()}',
// ),
),
),
该代码在Android上运行良好,既显示数字又显示".键盘上的字符.然而,在iOS设备上,".键盘上看不到字符.任何帮助都将不胜感激.