994501234567 is a string. +994 50 123 45 67 is a phone number. Humans read digits in groups, so a formatted number is easier to check and harder to mistype.
Format it everywhere the user sees it, including while they type:
One mask stops working when you add a country picker. Don't write a mask per country. See first if your country picker package ships a formatter. If not, phone_numbers_parser knows every country's format. Wrap it in a small TextInputFormatter with selected country's ISO code:
class PhoneInputFormatter extends TextInputFormatter { PhoneInputFormatter(this.isoCode); final IsoCode isoCode; @override TextEditingValue formatEditUpdate( TextEditingValue oldValue, TextEditingValue newValue, ) { // drop own spaces and pasted symbols final String digits = newValue.text.replaceAll( RegExp(r'[^0-9]'), '', ); return TextEditingValue( text: PhoneNumberFormatter.formatNsn(digits, isoCode), ); }}