There is a package country_code_picker.
Also there is country_picker 2.0.16 from where you can pick code too.
Usage:
@override
Widget build(BuildContext context) => new Scaffold(
body: new Center(
child: new CountryCodePicker(
onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT',
favorite: ['+39','FR'],
// optional. Shows only country name and flag
showCountryOnly: false,
// optional. Shows only country name and flag when popup is closed.
showOnlyCountryWhenClosed: false,
// optional. aligns the flag and the Text left
alignLeft: false,
),
),
);
To get the country code:
void _onCountryChange(CountryCode countryCode) {
//Todo : manipulate the selected country code here
print("New Country selected: " + countryCode.toString());
}