PhoneInputFormatter constructor

PhoneInputFormatter({
  1. ValueChanged<PhoneCountryData?>? onCountrySelected,
  2. bool allowEndlessPhone = false,
  3. bool shouldCorrectNumber = true,
  4. String? defaultCountryCode,
})

onCountrySelected when you enter a phone and a country is detected this callback gets called allowEndlessPhone if true, a phone can still be entering after the whole mask is matched. use if you are not sure that all masks are supported shouldCorrectNumber if input number is wrong in some country as Rus and Aus, the phone be corrected to new number defaultCountryCode if you set a default country code, the phone will be formatted according to its country mask and no leading country code will be present in the masked value

Implementation

PhoneInputFormatter({
  this.onCountrySelected,
  this.allowEndlessPhone = false,
  this.shouldCorrectNumber = true,
  this.defaultCountryCode,
});