颤音电话号码 - intl_phone_number软件包

发布于 2025-02-12 08:12:50 字数 396 浏览 0 评论 0原文

  InternationalPhoneNumberInput(
          onInputChanged: onInputChanged,
          cursorColor: kDarkGreyColor,
          initialValue: phoneNumber, //+961 or 961
          hintText: 'Phone Number',
...

我想将标志选择器的初始值设置为我的国家+961 但是初始值不起作用?如何设置初始值country代码

在此处输入图像描述

  InternationalPhoneNumberInput(
          onInputChanged: onInputChanged,
          cursorColor: kDarkGreyColor,
          initialValue: phoneNumber, //+961 or 961
          hintText: 'Phone Number',
...

I want to set the initial value of the flag selector to my country +961
However initial value is not working? How do i set the initial value country code

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

初懵 2025-02-19 08:12:50

它的工作如下

initialValue: PhoneNumber(isoCode: 'LB', dialCode:'+961'),

...

it worked as follows

initialValue: PhoneNumber(isoCode: 'LB', dialCode:'+961'),

...

半山落雨半山空 2025-02-19 08:12:50

当您创建电话号码时,添加一个ISO代码如下

PhoneNumber number = PhoneNumber(isoCode: 'LB');//lebanon's iso code

When you create a phone number add an Iso code like the following

PhoneNumber number = PhoneNumber(isoCode: 'LB');//lebanon's iso code
臻嫒无言 2025-02-19 08:12:50

在 @lou的答案中增加了价值,您可以设置与手机当前区域相对应的起始国家。

 initialValue: PhoneNumber(
    isoCode: Platform.localeName.split('_').last,
 ),

有关更多信息,请访问 https://github.com/natintosh/natintosh/intl_natintl_natintl_natl_number_inumber_inumber_input/155

Value addition in @Lou's answer, You can set a starting country that corresponds to the current region of the phone.

 initialValue: PhoneNumber(
    isoCode: Platform.localeName.split('_').last,
 ),

For more information check at https://github.com/natintosh/intl_phone_number_input/issues/155

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文