intl_phone_number_input 0.0.8 copy "intl_phone_number_input: ^0.0.8" to clipboard
intl_phone_number_input: ^0.0.8 copied to clipboard

outdated

A simple and customizable flutter package on International Phone Number Input.

Intl Phone Number Input #

A single and customizable flutter package for internation phone number input

Usage #

Constructors #

s/n Constructor
1 InternationalPhoneNumberInput
2 InternationalPhoneNumberInput.withCustomDecoration
3 InternationalPhoneNumberInput.withCustomBorder

Available Parameters #

InternationalPhoneNumberInput({
@required onInputChange,
      onInputValidated,
      inputBorder,
      inputDecoration,
      initialCountry2LetterCode = 'NG',
      hintText = '(800) 000-0001 23',
      shouldParse = true,
      shouldValidate = true,
      formatInput = true,
      errorMessage = 'Invalid phone number'});
Parameter Datatype Initial Value Default [1] Decoration [2] CustomBorder [3]
onInputChange function(string) null ✔️ ✔️ ✔️
onInputValidated function(string) null ✔️ ✔️ ✔️
inputBorder InputBorder null ✔️ ✔️
inputDecoration InputDecoration null ✔️ ✔️
initialCountry2LetterCode String NG ✔️ ✔️ ✔️
hintText String (800) 000-0001 23 ✔️ ✔️
shouldParse boolean true ✔️ ✔️ ✔️
shouldValidate boolean true ✔️ ✔️ ✔️
formatInput boolean true ✔️ ✔️ ✔️
errorMessage String Invalid phone number ✔️ ✔️

Examples #

InternationalPhoneNumberInput(
 onInputChange: onPhoneNumberChanged,
);

Media 1|100x200,20%

InternationalPhoneNumberInput(
  onInputChange: onPhoneNumberChanged,
  shouldParse: false,
  );

Media 2

InternationalPhoneNumberInput(
  onInputChange: onPhoneNumberChanged,
  shouldParse: true,
  shouldValidate: true,
  initialCountry2LetterCode: 'US',
  hintText: 'Insert phone number',
  );

Media 3

InternationalPhoneNumberInput.withCustomBorder(
  onInputChange: onPhoneNumberChanged,
  inputBorder: OutlineInputBorder(),
  hintText: '(100) 123-4567 8901',
  initialCountry2LetterCode: 'US',
  errorMessage: 'Wrong number',
);

Media 4

InternationalPhoneNumberInput.withCustomDecoration(
  onInputChange: onPhoneNumberChanged,
  initialCountry2LetterCode: 'US',
  inputDecoration: InputDecoration(
    border: OutlineInputBorder(
    borderRadius: BorderRadius.all(
      Radius.circular(40),
      ),
    ),
  ),
);

Media 4

InternationalPhoneNumberInput.withCustomDecoration(
  onInputChange: onPhoneNumberChanged,
  onInputValidated: onInputChanged,
  initialCountry2LetterCode: 'US',
  inputDecoration: InputDecoration(
    hintText: 'Enter phone number',
    errorText: valid ? null : 'Invalid',
    border: OutlineInputBorder(
      borderRadius: BorderRadius.all(
        Radius.circular(40),
      ),
    ),
  ),
);

Media 6

Dependencies #

  • [libphonenumber](https://pub.dev/packages/libphonenumber)
    

Credits #

A special thanks to niinyarko for the inspiration

769
likes
0
pub points
99%
popularity

Publisher

unverified uploader

A simple and customizable flutter package on International Phone Number Input.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, libphonenumber

More

Packages that depend on intl_phone_number_input