# flutter_country_selector 3.0.0

A country picker to select a country. Merged into phone_form_field, this package now re-exports it.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'flutter_country_selector:3.0.0'
```
Published: 2026-10-04T13:37:33.337013Z
Expected archive SHA-256: 6e127358c9b737ae572f700171456dd38442f964484f7d920fa0fda7fabc5f60

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- phone_form_field: ^12.0.0

## Package README (untrusted upstream documentation)
# Flutter Country Selector

> **This package has been merged into [phone_form_field](https://pub.dev/packages/phone_form_field).**
>
> Since 3.0.0, `flutter_country_selector` is a thin re-export of
> `package:phone_form_field/country_selector.dart`. The sources, the
> translations and the tests live in `phone_form_field` now, so prefer
> importing it directly:
>
> ```dart
> // still works
> import 'package:flutter_country_selector/flutter_country_selector.dart';
>
> // preferred
> import 'package:phone_form_field/country_selector.dart';
> ```

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/>

![](https://github.com/cedvdb/flutter_country_selector/blob/main/demo.gif?raw=true)

## 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.

```dart
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
- ro
- ru
- sv
- tr
- uk
- ur
- uz
- vi
- zh  

### Setup

Example setup:

```dart
import 'package:material_ui/material_ui.dart';
import 'package:phone_form_field/country_selector.dart';
import 'package:phone_form_field/phone_form_field.dart';

const MaterialApp(
  locale: Locale('en'),
  supportedLocales: [
    Locale('en'),
  ],
  localizationsDelegates: PhoneFieldLocalization.delegates,
  // ...
)
```

`MaterialApp` is `material_ui`'s rather than the one of `package:flutter/material.dart`,
as the widgets are built on [`material_ui`](https://pub.dev/packages/material_ui)
(decoupled from the framework in Flutter 3.47.0). `PhoneFieldLocalization.delegates`
holds `material_ui`'s `GlobalMaterialLocalizations.delegates`, following the
[material_ui migration guide](https://pub.dev/packages/material_ui#step-2-migrate-localizations-if-needed);
the generated `CountrySelectorLocalization.localizationsDelegates` holds the
`flutter_localizations` ones, which are a different `MaterialLocalizations` type
and throw `No MaterialLocalizations found.` for non english locales.

# 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>

## Development

```sh
git clone https://github.com/cedvdb/flutter_country_selector.git
cd flutter_country_selector
flutter pub get
flutter test

# the example has its own test
cd example && flutter pub get && flutter test
```

This package is a thin re-export, so its tests only smoke test the re-exported
API against the published `phone_form_field`. To try out an unreleased
`phone_form_field` change together with it, point `pubspec.yaml` at a sibling
checkout temporarily:

```yaml
dependency_overrides:
  phone_form_field:
    path: ../phone_form_field
```

## Changelog
## 3.0.0

- **[Breaking]** The country selector has been merged into
  [phone_form_field](https://pub.dev/packages/phone_form_field). The sources,
  the arbs, the generated localizations and the tests now live there so that the
  phone field and the country selector share a single set of sources, a single
  l10n setup and a single dependency tree (they always shipped together). This
  package is now a thin re-export of
  `package:phone_form_field/country_selector.dart`:
  `import 'package:flutter_country_selector/flutter_country_selector.dart';`
  keeps working, `import 'package:phone_form_field/country_selector.dart';` is
  preferred.
- `CountrySelectorLocalization` and `CountrySelectorLocalizationEn` are now
  aliases of `PhoneFieldLocalizationImpl` and `PhoneFieldLocalizationImplEn`,
  so `.delegate`, `.of(context)`, `.supportedLocales` and the country names
  extension keep working.

## 2.0.4

- Add Romanian localization
- Added missing Japanese and Thai translations

## 2.0.3

- Use deferred imports for localizations


## 2.0.2

- Fix Spanish country name translations (China, Turkey, Togo, Isle of Man, Jordan, Guyana, Libya, Iran, French Polynesia and others were mistranslated or misspelled)

## 2.0.1

- Bump version

## 2.0.0

- [Breaking]: Require dart >=3.5.0
- [Breaking]: Require flutter >=3.47.0
- Migrate to the new material_ui package which has been decoupled from the flutter framework in flutter 3.47.0

## 1.0.19

- Semantics fix for search field

## 1.0.18

- Add Polish localization

## 1.0.17+1

* Auto publish workflow implemented

## 1.0.17

* Fix a memory leak in the CountrySelectorBase widget

## 1.0.16

* Use theme default for `AppBar` elevation.

## 1.0.15

* Added fix for Hebrew localization

## 1.0.14

* Add Catalan

## 1.0.13

* Add localizations for Urdu

## 1.0.12

* Fix translation in Vietnamese
* Add localizations for Hebrew
* Upgrade dependency

## 1.0.11

* Added localizations for vi

## 1.0.10

* Added localizations for Korean

## 1.0.9

* Fix translation in Portuguese

## 1.0.8

* Fix translation el
* Update readme

## 1.0.7

* Fix missing localizations
* Use newer version of circle_flags
* Add readme note about overwriting flags

## 1.0.6

* Added localizations for hu
* Fixed fr localizations

## 1.0.5

* Added missing localizations for pt and ru
* Upgraded phone_numbers_parser

## 1.0.4

* Improve accessibility

## 1.0.3

* Update demo gif

## 1.0.2

* Add `countryDialCode` method to `CountrySelectorLocalization`

## 1.0.1

* Add demo gif

## 1.0.0

* Initial release







 
