Comments (3)
@illiashvedov the package seems to work well on my end could you pls provide more information
from intl_phone_number_input.
Hi @natintosh
import 'package:flutter/material.dart';
import 'package:intl_phone_number_input/intl_phone_number_input.dart';
import 'package:my_project/assets/colors/colors.dart';
import 'package:my_project/localizations.dart';
import 'package:my_project/widgets/phone_number_input/const.dart';
class PhoneNumberInput extends StatefulWidget {
PhoneNumberInput({
Key key,
@required this.focusNode,
@required this.onSubmit,
@required this.onInputChanged,
this.inputDecoration,
this.hintText,
this.keyboardAction = TextInputAction.next,
this.phoneNumber,
this.autoValidate = false,
TextStyle textStyle,
TextEditingController textEditingController,
}) : assert(focusNode != null),
assert(onSubmit != null),
assert(onInputChanged != null),
textStyle = textStyle ?? TextStyle(fontSize: 20, color: greyColor),
textEditingController =
textEditingController ?? TextEditingController(),
super(key: key);
final FocusNode focusNode;
final VoidCallback onSubmit;
final ValueChanged<String> onInputChanged;
final InputDecoration inputDecoration;
final TextStyle textStyle;
final String hintText;
final String phoneNumber;
final TextInputAction keyboardAction;
final TextEditingController textEditingController;
final bool autoValidate;
@override
_PhoneNumberInputState createState() => _PhoneNumberInputState();
}
class _PhoneNumberInputState extends State<PhoneNumberInput> {
PhoneNumber _initialPhoneNumber;
@override
void initState() {
if (widget.phoneNumber != null) {
_parsablePhoneNumber(widget.phoneNumber);
}
super.initState();
}
Future _parsablePhoneNumber(String phoneNumber) async {
if (phoneNumber.isNotEmpty) {
PhoneNumber numberRegionInfo =
await PhoneNumber.getRegionInfoFromPhoneNumber(phoneNumber);
setState(() {
_initialPhoneNumber = numberRegionInfo;
});
}
}
@override
Widget build(BuildContext context) {
final local = CarWashLocalizations.of(context);
return InternationalPhoneNumberInput(
textFieldController: widget.textEditingController,
countries: countries,
textStyle: widget.textStyle,
hintText: widget.hintText,
errorMessage: local.invalidPhoneNumber,
keyboardAction: widget.keyboardAction,
initialValue: _initialPhoneNumber,
selectorType: PhoneInputSelectorType.DIALOG,
inputDecoration: widget.inputDecoration,
onInputChanged: _onInputChanged,
ignoreBlank: true,
focusNode: widget.focusNode,
onSubmit: widget.onSubmit,
autoValidate: widget.autoValidate,
);
}
void _onInputChanged(PhoneNumber phoneNumber) =>
widget.onInputChanged(phoneNumber.phoneNumber);
}
As you can see, I have a wrapper for your class, it is possible that it will explicitly null as the value passed to your class, after null gets there I cannot change the country, and also I can`t enter any values. I donβt exclude that I can do something wrong
from intl_phone_number_input.
Oh please forgive me, because I just realized that this is my personal problem with my project, I just made a new project and this problem did not reproduce, I apologize for the extra nerves
from intl_phone_number_input.
Related Issues (20)
- 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
- Error: Invalid value, Input field allowing special characters
- validator .. needs refactoring
- mobile number is incorrect HOT 2
- Get Phone Detail from contact list
- isoCode: 'MA' validators accept only 06 prefix !
- Allow Usage of ISO Codes Instead of Country Logos in the Leading of Input Field
- Version soloving failed
- Material 3 SubTitle Style is Deprecated . can you please change as per the Material 3 and Make a Release HOT 2
- Change the type of initCountry to String
- validatorMessage doesnt appear if is different of AutovalidateMode.always or doesnt triggered onChanged
- Not compatible with xcode 15 phonenumberkit deployment target 12 HOT 8
- Add Korean Translation Support
- PROJECT STILL ACTIVE?? kindly update please
- Programmatically change selected country code, or fill fields (flag and text input) using PhoneNumber
- selector customization needed HOT 1
- I
- IOS error : Compiling for iOS 11.0, but module 'PhoneNumberKit' has a minimum deployment target of iOS 12.0:
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.