gpt4 book ai didi

Flutter: TextField behave differently from emulator and device(颤动:Textfield的行为与仿真器和设备不同)

转载 作者:bug小助手 更新时间:2023-10-24 18:38:50 25 4
gpt4 key购买 nike



The TextField is coded below to only allow digits, decimal and dash (negative number).

Textfield的编码如下,仅允许数字、小数和破折号(负数)。


                          child: TextField(
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Enter the answer',
),
controller: _controller,
textAlign: TextAlign.center,
keyboardType: const TextInputType.numberWithOptions(
decimal: true,
signed: false,
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp('[0-9.-]'),
),
],
),

However, emulator and devices shows differently (dash is missing, Samsung device uses default Samsung keyboard)
Using GBoard in the Samsung device will solve the issue.

然而,模拟器和设备显示不同(破折号丢失,三星设备使用默认的三星键盘)在三星设备中使用Gboard将解决这个问题。


What is the best practice to solve this issue since other user might have different phone models/keyboards?

由于其他用户可能具有不同的手机型号/键盘,解决此问题的最佳实践是什么?


ThanksSide by side comparison

谢谢


更多回答
优秀答案推荐
更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com