Home > Enterprise >  flutter how to get country list in a dropdown, need only county list and country code
flutter how to get country list in a dropdown, need only county list and country code

Time:06-02

I need like this -> click the image flutter how to get the country list in a dropdown, need only the county list and country code.

CodePudding user response:

This would give you a dropdown of country flag with their country code. And you can find a list of country codes here

class dropdown extends StatelessWidget {
  

const dropdown({
    Key? key,
    required this.locale,
  }) : super(key: key);

  final Locale? locale;

  @override
  Widget build(BuildContext context) {
    _getFlag(String code) {
      switch (code) {

    case 'es':
      return "           
  • Related