Comments (10)
Thanks, @inkersgithub worked for me
from intl_phone_number_input.
Hi @miller619, this is expected behavior. This is so because the TextEditingController()
is working with the TextField
, therefore any input the TextField
has it what the TextEditingController()
would return. I hope this helps
from intl_phone_number_input.
In that case how do I return the phone number along with the country code?
from intl_phone_number_input.
Oh by returning do you mean updating ??
from intl_phone_number_input.
Yea.. like get the phone number along with the country code to be saved into database, shared preference, etc. Because the controller only returns the number and not the country code.
from intl_phone_number_input.
ok. So to updated the input and the country code selected just use setState on the initialValue, which accepts a phone number and iso code. I hope this helps
from intl_phone_number_input.
please take a look at this
const InternationalPhoneNumberInput({ Key key, this.selectorType, @required this.onInputChanged, this.onInputValidated, this.focusNode, this.textFieldController, this.onSubmit, this.keyboardAction, this.countries, this.textStyle, this.inputBorder, this.inputDecoration, this.searchBoxDecoration, this.initialCountry2LetterCode = 'NG', this.hintText = 'Phone Number', this.isEnabled = true, this.autoValidate = false, this.formatInput = true, this.errorMessage = 'Invalid phone number', this.ignoreBlank = false, this.locale, }) : super(key: key);
There is no initialValue in the constructor.
from intl_phone_number_input.
It seems you are using a previous version of the package, please update it to the latest version intl_phone_number_input: ^0.4.2
from intl_phone_number_input.
Updated. Now i have initialValue in constructor but still cannot get the value. Tried following your example again and again. Not leading me anywhere. I keep getting only the phone number without the coutrycode.
from intl_phone_number_input.
I used the onInputChanged event as below
PhoneNumber phoneNumber;
.
.
InternationalPhoneNumberInput(
.
.
onInputChanged: (number) {
setState(() {
phoneNumber = number;
});
},
.
)
void someFunction(){
print(phoneNumber.dialCode);
}
from intl_phone_number_input.
Related Issues (20)
- Add background color for selector button
- Support new angolan operator's phone numbers, Africell, +24495*******
- get more info phone numbers when onInputChanged
- Country Flag Padding change when changing PhoneInputSelectorType.DROPDOWN to selectorType: PhoneInputSelectorType.BOTTOM_SHEET HOT 2
- Egypt 015 Code
- smartAuth integration or isNotValid editing access
- Styling option for the country selector dialog box. HOT 1
- Font color of my app is white and country names are not seen due to this.
- Invalid country code error HOT 10
- Curser issue while formating numbers HOT 7
- Number field can't be selected by integration test
- Problem: The number input field on IOS add also the country code HOT 24
- [Question] Confusion about the attribute "DialCode"
- make search request non case sensitive
- On iOS after the phone number is valed country dialcode is added to the number so it appears twice HOT 2
- Autofill does not update the flag
- The phone number no loading
- Enable or Disable selection of country from list HOT 1
- Hello no issue it's mistake sorry :) HOT 1
- Phone number on IOS does not work with country code HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intl_phone_number_input.