country code selector
a flutter package for showing a country code selector.
usage
just put the component in your application setting the onchanged callback.
@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,
),
),
);
note: your onchanged function can be any function of the type shown below:
(countrycode)->dynamic
example:
void _oncountrychange(countrycode countrycode) {
//todo : manipulate the selected country code here
print("new country selected: " + countrycode.tostring());
}
Comments are closed.