Closed LastExileUA closed 4 years ago
I am facing same issue, this was not getting fixed so I made my own phone field. You can use it from here until this is fixed.
Hi @LastExileUA thanks for raising this issue, it is quite similar to #40 I was unable to find out the cause of this but now I know and its all thanks to you. 👍👍👍
Hi, @LastExileUA I just pushed a fix, I need to resolve some issues before I publishing. Thank again.
If you set
autoFormat: true
or setPhoneNumber(isoCode: 'BR', '5167634469')
, it remove lead "5" digit. gif to demonstrateIt's happen because
value.replaceAll(RegExp('^([\\+?${this.dialCode}\\s?]+)'), '')
, it can eat next digits after dialCode, works not only with BR. I replaced it withvalue.replaceFirst(RegExp('^([\\+]?${number.dialCode}[\\s]?)', '')
, and it works fine. Replace has been made inphone_number.dart
andas_you_type_formatter.dart
I have done it in my fork