【问题标题】:How to include plus symbol to a numeric keyboard如何在数字键盘中包含加号
【发布时间】:2022-01-17 03:50:21
【问题描述】:

我想知道如何在我的应用程序中使用包含加号(“+”)的数字键盘实现 TextFormField,以方便用户输入国际电话号码。

 TextFormField(
    controller: phoneNumberController,
    keyboardType: TextInputType.number, // Fix to include plus symbol
),

【问题讨论】:

  • 如果这个答案有用,请勾选接受

标签: flutter dart textformfield


【解决方案1】:

在 TextInputType.phone 处更改类型 TextInputType.number

TextFormField(
    controller: phoneNumberController,
    keyboardType: TextInputType.phone, // Fix to include plus symbol
),

【讨论】:

  • 哇非常感谢猫王,当他们是这么简单的解决方案时,我总是卡住!
猜你喜欢
  • 2012-01-25
  • 1970-01-01
  • 2015-05-15
  • 2015-06-13
  • 2021-09-04
  • 1970-01-01
  • 1970-01-01
  • 2019-05-26
  • 1970-01-01
相关资源
最近更新 更多