flutter_flag_selector
pub version MIT license

The country picker for Flutter.

SVG flags, dial codes, ranked search and country names in 20 languages. Open it as a bottom sheet, a dialog, a popup menu or a draggable sheet. It preselects the user's country.

flutter pub add flutter_flag_selector

Live demo, built with Flutter web. Try it.

Four display modes

Same picker, same search, presented the way that fits your screen.

Everything a country field needs

Built for phone number inputs, sign-up flows and shipping forms.

213

Countries and territories

ISO 2 and ISO 3 codes, dial codes, currencies and time zones.

20

Languages

Country names in English, French, Spanish, German, Japanese, Arabic and more.

4

Display modes

Bottom sheet, dialog, popup menu and draggable sheet.

Ranked search

By name, ISO code or dial code. “ger” finds Germany first, “+33” finds France.

Device country

Preselects the user's country from the platform locale.

Fully customizable

30+ properties, plus builders for the flag, the items and the whole picker.

Get started

Add the package, drop the widget in, read the selected country.

import 'package:flutter_flag_selector/flutter_flag_selector.dart';

FlagSelector(
  // Optional: defaults to the device's country.
  flagSelectorInitialCountry: 'fr',
  flagSelectorLanguageCode: 'fr',
  flagSelectorOptionType: FlagSelectorOptionType.modalBottomSheet,
  onFlagSelectorCountryChanged: (country) {
    print('${country.name} ${country.dialCode}');
  },
)
  • Pick a mode with flagSelectorOptionType: modalBottomSheet, dialog, popupMenu or draggableSheet.
  • Change the language of country names with flagSelectorLanguageCode.
  • Limit the list with flagSelectorCountries; search stays within it.
  • Query the data directly with CountryService: by code, currency, region or free text.
  • Full API reference in the README and on pub.dev.