intl_phone_number_input 0.1.2+2

Flutter Android iOS

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

Intl Phone Number Input #

A single and customizable flutter package for international phone number input

What's new #

* Added TextEditingController
* TextField formats on TextEditingController Text change
* Added KeyboardActionType
* Callback that listens to Keyboard Action
* Added FocusNode
* Custom list of countries e.g. ['NG', 'GH', 'BJ' 'TG', 'CI']

Usage #

Constructors #

s/nConstructor
1InternationalPhoneNumberInput
2InternationalPhoneNumberInput.withCustomDecoration
3InternationalPhoneNumberInput.withCustomBorder

Available Parameters #

InternationalPhoneNumberInput({
    @required this.onInputChanged,
    this.onInputValidated,
    this.focusNode,
    this.textFieldController,
    this.onSubmit,
    this.keyboardAction,
    this.countries,
    this.inputBorder,
    this.inputDecoration,
    this.initialCountry2LetterCode = 'NG',
    this.hintText = '(800) 000-0001 23',
    this.shouldParse = true,
    this.shouldValidate = true,
    this.formatInput = true,
    this.errorMessage = 'Invalid phone number',
    });
ParameterDatatypeInitial ValueDefault [1]Decoration [2]CustomBorder [3]
onInputChangefunction(string)null✔️✔️✔️
onInputValidatedfunction(string)null✔️✔️✔️
focusNodeFocusNodenull✔️✔️✔️
textFieldControllerTextEditingControllerTextEditingController()✔️✔️✔️
onSubmitFunction()null✔️✔️✔️
keyboardActionTextInputActionnull✔️✔️✔️
countriesListnull✔️✔️✔️
inputBorderInputBordernull✔️✔️
inputDecorationInputDecorationnull✔️✔️
initialCountry2LetterCodeStringNG✔️✔️✔️
hintTextString(800) 000-0001 23✔️✔️
shouldParsebooleantrue✔️✔️✔️
shouldValidatebooleantrue✔️✔️✔️
formatInputbooleantrue✔️✔️✔️
errorMessageStringInvalid phone number✔️✔️

Examples #

InternationalPhoneNumberInput(
 onInputChanged: onPhoneNumberChanged,
);

Media 1|100x200,20%

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

Media 2

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

Media 3

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

Media 4

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

Media 4

InternationalPhoneNumberInput.withCustomDecoration(
  onInputChanged: 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 #

Credits #

A special thanks to niinyarko

102
likes
80
pub points
95%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

ogunye4nao@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, libphonenumber

More

Packages that depend on intl_phone_number_input