Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial flag asset by country code #1

Closed
ricardonior29 opened this issue Oct 22, 2020 · 2 comments
Closed

Initial flag asset by country code #1

ricardonior29 opened this issue Oct 22, 2020 · 2 comments

Comments

@ricardonior29
Copy link

I send the callingCode and countryCode to a server (not the flag). But when i want to build the form again and paint the flag with the server response, i just have the country code.

So, please change the name of the flags (example "US.png"). This way I can match the countryCode with the flag route (asset)

Thanks

@dev-naiksan
Copy link
Owner

Hello @ricardonior29 please use below method. I have added the same in readme now.
Country country = await getCountryByCountryCode(context, 'US');
Alternatively you can retrieve all the countries using
getCountries(context);

@zooRg
Copy link

zooRg commented Jan 24, 2022

if use method getCountries and use path for image

Image.asset(
  'packages/country_calling_code_picker/' + countries.first.flag,
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants