Exposed method to get the country information of the initial selection

This commit is contained in:
Rangana Perera
2019-09-04 13:02:20 +05:30
parent ce9d724747
commit e41d6f2031
2 changed files with 19 additions and 4 deletions

View File

@@ -26,10 +26,13 @@ class _MyAppState extends State<MyApp> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
CountryCodePicker(
onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT',
favorite: ['+39', 'FR']),
onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT',
favorite: ['+39', 'FR'],
//Get the country information relevant to the initial selection
getInitialData: (code) => print("${code.name} ${code.dialCode}"),
),
SizedBox(
width: 400,
height: 60,