country_geocode_picker

A simple, drop-in country picker for Flutter. Add a searchable country dropdown or a phone number field with a dial-code prefix — no setup, no API keys, no network calls. Just add the widget and go.

Comes with 200+ countries baked right into the package: names, local names, ISO codes, dial codes, flags, and geocode language info.

Why you'll like it

  • Just works out of the box — drop in CountryDropdown or CountryCodePhoneField and you're done.
  • Search built in — type a name, local name, ISO code, or dial code.
  • Fully yours to restyle — swap the field, the list rows, or the whole picker UI whenever you want more control.
  • Pin, restrict, or hide countries — show favorites first, limit to a region, or exclude ones you don't need.
  • No internet required — the whole dataset ships inside the package.

Country picker

Type to search, tap to pick. Favorites you set show up first.

CountryDropdown(
  favoriteCountryCodes: const ['NP', 'IN', 'US'],
  onChanged: (country) => print(country.dialCode),
)

The country picker sheet open, showing the search bar and Nepal, India, and United States pinned at the top

Phone number field

A normal text field for the number, with a tappable flag + dial code in front. Tapping it opens the same picker as above.

CountryCodePhoneField(
  decoration: const InputDecoration(
    border: OutlineInputBorder(),
    hintText: 'Phone number',
  ),
  onChanged: (value) => print(value.e164), // e.g. +9779812345678
)

The phone number field showing Nepal's flag and +977 dial code prefix, ready for input

More things you can do

Pin, restrict, or exclude countries

CountryDropdown(
  favoriteCountryCodes: const ['NP', 'IN'],
  excludeCountryCodes: const ['KP'],
)

Make your own closed-state widget (chip, button, whatever you like)

CountryDropdown(
  builder: (context, selected, openPicker) => GestureDetector(
    onTap: openPicker,
    child: Chip(label: Text(selected?.name ?? 'Pick a country')),
  ),
)

Just want the raw list of countries?

final countries = await CountryRepository.loadAll();

What a Country looks like

class Country {
  final int id;
  final String name;         // "Nepal"
  final String localName;    // "नेपाली"
  final String dialCode;     // "+977"
  final String countryCode;  // "NP" (ISO 3166-1 alpha-2)
  final String flag;         // "🇳🇵"
  final List<GeocodeLanguage> geocodeLanguages;
}

Check out the example app for a full working demo.

Libraries

country_geocode_picker
A customizable country picker for Flutter — searchable dropdown / bottom-sheet country selector and a phone number field with dial code picking, flags, and localized geocode language metadata.