Daniel-Ioannou / flutter_country_picker

A flutter package to select a country from a list of countries.
https://pub.dev/packages/country_picker
MIT License
123 stars 172 forks source link

Integrate country flag api for windows #116

Closed bahricanyesil closed 1 year ago

bahricanyesil commented 1 year ago

Flag emojis are not supported on the Windows platform as mentioned in issue #107, refer to here for details.

Therefore, 2 solutions can come to mind are: 1- Adding flags as asset files and using them 2- Integrating an API to fetch the country flags by country code

I preferred to choose the second option to avoid unwanted package size increases. Adding almost all flags can enlarge the size of the package. Using an API and fetching it as a network image can be advantageous in this aspect.

However, it also has 2 simple disadvantages: 1- Requirement of internet 2- Dependency on the 3rd party API

Considering these disadvantages, I also added a custom flag builder function parameter (see CustomFlagBuilder) and also a type definition for it. This custom flag builder allows users to implement their own country flag widgets by using the country information.

Here's a screenshot from the example app with the changes I made: image

I am open to any review and suggestions. Thanks for the package.

Daniel-Ioannou commented 1 year ago

@bahricanyesil Thank you for your contribution. Released in v2.0.21.

bahricanyesil commented 1 year ago

@bahricanyesil Thank you for your contribution. Released in v2.0.21.

Thank you for the release 🚀