Comments (3)
Added.
from intl_phone_field.
well, this feature can be quite usefull. Though it can be implemented using controllers, but still if you want it to be available like initialValue argument, you can send a PR.
from intl_phone_field.
This feature was added but I'm having one hell of a time trying to populate this value when I load my widget. I'm grabbing the mobile number successfully using the mobile_number plugin and when I try to use that variable with the number stored it doesnt show up. I have also tried to use storage saved values when I call the getMobile method and then calling the saved value when the widget loads still no luck
Having said that when I do a restart in vscode the widget updates and the number fills in. I have then implemented the use of GetX using obs on the value and Obx method wrapped around intlPhoneField but its still not filling the input box.
Here is the widget portion...
child: Obx(
() => IntlPhoneField(
dropdownIcon: Icon(
Icons.arrow_drop_down,
color: Theme.of(context).colorScheme.secondary,
),
//controller: phoneController,
onChanged: (phone) {
print(phone.completeNumber);
print(phone.countryCode);
print(phone.number);
},
cursorColor: Theme.of(context).colorScheme.secondary,
cursorWidth: 3.sp,
keyboardType: TextInputType.number,
**initialValue: permController.coreMobileNumber.value,**
dropdownTextStyle: TextStyle(
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
fontSize: 15.sp,
letterSpacing: 1.2.sp),
and here is the method I'm using to grab the mobile number...
final coreMobileNumber = ''.obs;
Future<void> getMobileNumber() async {
final completeNumber = await MobileNumber.mobileNumber;
var properNumber = '';
if (completeNumber != null) {
properNumber = completeNumber.substring(completeNumber.length - 10);
}
coreMobileNumber.value = properNumber;
Storage.saveValue('mobileNumber', properNumber);
}
any help using this feature would be much appreciated
from intl_phone_field.
Related Issues (20)
- Input Formatter
- ISO code and area code HOT 1
- country code issue HOT 1
- color text [languageCode] HOT 3
- showDialog to showModalBottomSheet
- Field Validation HOT 3
- initialCountryCode do not work with country dial code HOT 2
- PickerDialog search TextField text style changing option not available HOT 1
- When Keyboard open it gives bottom over flow error for landscape mode
- Drop down BackGround color
- update Italy, correct is +39 HOT 5
- Madagascar phone number length is 9, not 10 HOT 1
- Field Validation Doesn't Work Perfectly HOT 1
- Search country field
- VALIDATION IS NOT PERFECT HOT 1
- Useless memory usage
- initialCountryCode number not working HOT 1
- On LightTheme environment the flag is not displaying HOT 1
- Country number count error for some countries
- Creating a proper maintainable fork HOT 2
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_field.