Search packages, repositories and app categories

Package detailsv3.0.0

flutter_country_selector

how a country picker to select a country

AndroidiOSWebmacOSWindowsLinux
30-day downloads
56.4K
Likes
12
Pub points
160

Install package

flutter pub add flutter_country_selector

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides a country picker widget for selecting countries, ideal for forms requiring country input. It supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The picker displays country names and flags, enabling users to easily choose a country with a clean, intuitive interface. It is lightweight and integrates seamlessly into existing Flutter applications. The package is open-source and maintained on GitHub, allowing community contributions and transparency.

Use cases

  • User registration with country selection
  • International form inputs
  • Phone number input with country code
  • Travel or shipping address forms
  • Multi-language app localization

Key features

  • Displays country flags and names
  • Supports platform-agnostic deployment
  • Easy integration with Flutter forms
  • Customizable appearance
  • Open-source and actively maintained

Suitable for

  • Developers building international apps
  • Apps requiring country-specific data
  • Form-heavy applications
  • Cross-platform mobile and web projects

Considerations

  • May require additional styling for custom themes
  • Limited to country selection (no region or city support)
  • Depends on external flag assets
  • Not optimized for very large country lists

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Country Selector

Country selector of the phone_form_field package exported in its own package.

Features

  • localization: lots of supported languages
  • semantics applied

Demo

Demo available here: https://cedvdb.github.io/flutter_country_selector/

Usage

Use CountrySelector.page if you need to show the selector inside a widget that is full screen. If you need to show the selector inside a modal of some sort, use CountrySelector.sheet instead.

Navigator.of(context).push(
  MaterialPageRoute(
    builder: (ctx) => CountrySelector.page(
      onCountrySelected: (country) => Navigator.of(context).pop(country),
    ),
  ),
)

Localization

Dynamic localization

Use CountrySelectorLocalization.of(context)?.countryName(isoCode) when you need to dynamically localize the name of a country.

Supported languages
  • ar
  • de
  • el
  • en
  • es
  • fa
  • fr
  • he
  • hi
  • hu
  • it
  • ko
  • ku
  • nb
  • nl
  • pl
  • pt
  • ru
  • sv
  • tr
  • uk
  • ur
  • uz
  • vi
  • zh
Setup

Example setup:


const MaterialApp(
  locale: Locale('en'),
  supportedLocales: [
    Locale('en'),
  ],
  localizationsDelegates: [
    GlobalMaterialLocalizations.delegate,
    CountrySelectorLocalization.delegate,
  ],
  // ...
)

Overwriting or adding custom flags

Some users have expressed their need to change some flags due to political reasons, or stylistic reasons. You might also wish to add your own flags. To do so refer to this issue: https://github.com/cedvdb/phone_form_field/issues/222

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package