Flag image #68
-
How can i get the Flag Image |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
@ashishgkwd534 Example: import 'package:country_picker/src/utils.dart';
Text(
Utils.countryCodeToEmoji(country.countryCode),
style: const TextStyle(fontSize: 25),
); Note that Utils is not expose to the package so you have to import it: |
Beta Was this translation helpful? Give feedback.
-
Amazing thanks |
Beta Was this translation helpful? Give feedback.
-
@Daniel-Ioannou how to access country.countrycode out of showCountryPicker? |
Beta Was this translation helpful? Give feedback.
-
@Nishtha-Iwebservices All you have to do is declare a late variable String to hold your country code of initialize it with your default country. Inside the showCountryPicker, setState of the declared variable to the selected country
|
Beta Was this translation helpful? Give feedback.
@ashishgkwd534
The package use emoji to show the flags (not images) you can get the flags emoji with
Utils.countryCodeToEmoji(country.countryCode;
Example:
Note that Utils is not expose to the package so you have to import it:
import 'package:country_picker/src/utils.dart';