{"id":13551427,"url":"https://github.com/imtoori/CountryCodePicker","last_synced_at":"2025-04-03T01:32:47.299Z","repository":{"id":34357611,"uuid":"126512452","full_name":"imtoori/CountryCodePicker","owner":"imtoori","description":"A flutter package for showing a country code selector.","archived":true,"fork":false,"pushed_at":"2023-06-12T04:08:00.000Z","size":9828,"stargazers_count":222,"open_issues_count":56,"forks_count":433,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-01T12:24:46.215Z","etag":null,"topics":["country-codes","country-picker","flutter","flutter-plugin"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imtoori.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-23T16:37:43.000Z","updated_at":"2024-06-25T10:51:30.000Z","dependencies_parsed_at":"2022-08-03T02:45:18.481Z","dependency_job_id":"09844dce-e273-45a4-a0f4-3c7793bf7ac6","html_url":"https://github.com/imtoori/CountryCodePicker","commit_stats":{"total_commits":199,"total_committers":41,"mean_commits":4.853658536585366,"dds":"0.39698492462311563","last_synced_commit":"a4b2fe3179ca0474569f69a0c05d57fc5bd8a9f1"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtoori%2FCountryCodePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtoori%2FCountryCodePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtoori%2FCountryCodePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtoori%2FCountryCodePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imtoori","download_url":"https://codeload.github.com/imtoori/CountryCodePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222905907,"owners_count":17055819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["country-codes","country-picker","flutter","flutter-plugin"],"created_at":"2024-08-01T12:01:48.118Z","updated_at":"2024-11-03T21:32:20.921Z","avatar_url":"https://github.com/imtoori.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"[![Pub](https://img.shields.io/pub/v/country_code_picker.svg)](https://pub.dartlang.org/packages/country_code_picker)\n\n# country_code_picker\n\nA flutter package for showing a country code selector.\n\nIt supports i18n for 70 languages.\n\nCheck the example on web! https://imtoori.dev/CountryCodePicker/#/\n\n\u003cimg src=\"https://raw.githubusercontent.com/Salvatore-Giordano/CountryCodePicker/master/screenshots/screen1.png\" width=\"240\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Salvatore-Giordano/CountryCodePicker/master/screenshots/screen2.png\" width=\"240\"/\u003e\n\n## Usage\n\nJust put the component in your application setting the onChanged callback.\n\n```dart\n\n@override\n Widget build(BuildContext context) =\u003e new Scaffold(\n     body: Center(\n       child: CountryCodePicker(\n         onChanged: print,\n         // Initial selection and favorite can be one of code ('IT') OR dial_code('+39')\n         initialSelection: 'IT',\n         favorite: ['+39','FR'],\n         // optional. Shows only country name and flag\n         showCountryOnly: false,\n         // optional. Shows only country name and flag when popup is closed.\n         showOnlyCountryWhenClosed: false,\n         // optional. aligns the flag and the Text left\n         alignLeft: false,\n       ),\n     ),\n );\n\n```\n\nExample:\n\n```dart\n\nvoid _onCountryChange(CountryCode countryCode) {\n    //TODO : manipulate the selected country code here\n    print(\"New Country selected: \" + countryCode.toString());\n  }\n\n```\n\n### i18n\n\nJust add the `CountryLocalizations.delegate` in the list of your app delegates\n\n```dart\n return new MaterialApp(\n      supportedLocales: [\n         Locale(\"af\"),\n        Locale(\"am\"),\n        Locale(\"ar\"),\n        Locale(\"az\"),\n        Locale(\"be\"),\n        Locale(\"bg\"),\n        Locale(\"bn\"),\n        Locale(\"bs\"),\n        Locale(\"ca\"),\n        Locale(\"cs\"),\n        Locale(\"da\"),\n        Locale(\"de\"),\n        Locale(\"el\"),\n        Locale(\"en\"),\n        Locale(\"es\"),\n        Locale(\"et\"),\n        Locale(\"fa\"),\n        Locale(\"fi\"),\n        Locale(\"fr\"),\n        Locale(\"gl\"),\n        Locale(\"ha\"),\n        Locale(\"he\"),\n        Locale(\"hi\"),\n        Locale(\"hr\"),\n        Locale(\"hu\"),\n        Locale(\"hy\"),\n        Locale(\"id\"),\n        Locale(\"is\"),\n        Locale(\"it\"),\n        Locale(\"ja\"),\n        Locale(\"ka\"),\n        Locale(\"kk\"),\n        Locale(\"km\"),\n        Locale(\"ko\"),\n        Locale(\"ku\"),\n        Locale(\"ky\"),\n        Locale(\"lt\"),\n        Locale(\"lv\"),\n        Locale(\"mk\"),\n        Locale(\"ml\"),\n        Locale(\"mn\"),\n        Locale(\"ms\"),\n        Locale(\"nb\"),\n        Locale(\"nl\"),\n        Locale(\"nn\"),\n        Locale(\"no\"),\n        Locale(\"pl\"),\n        Locale(\"ps\"),\n        Locale(\"pt\"),\n        Locale(\"ro\"),\n        Locale(\"ru\"),\n        Locale(\"sd\"),\n        Locale(\"sk\"),\n        Locale(\"sl\"),\n        Locale(\"so\"),\n        Locale(\"sq\"),\n        Locale(\"sr\"),\n        Locale(\"sv\"),\n        Locale(\"ta\"),\n        Locale(\"tg\"),\n        Locale(\"th\"),\n        Locale(\"tk\"),\n        Locale(\"tr\"),\n        Locale(\"tt\"),\n        Locale(\"uk\"),\n        Locale(\"ug\"),\n        Locale(\"ur\"),\n        Locale(\"uz\"),\n        Locale(\"vi\"),\n        Locale(\"zh\")\n      ],\n      localizationsDelegates: [\n        CountryLocalizations.delegate,\n        GlobalMaterialLocalizations.delegate,\n        GlobalWidgetsLocalizations.delegate,\n      ],\n```\n\n## Customization\n\nHere is a list of properties available to customize your widget:\n\n| Name | Type | Description |\n|-----|-----|------|\n|onChanged| ValueChanged\u003cCountryCode\u003e | callback invoked when the selection changes |\n|onInit| ValueChanged\u003cCountryCode\u003e | callback invoked during initialization of the widget |\n|initialSelection| String | used to set the initial selected value |\n|favorite| List\u003cString\u003e | used to populate the favorite country list |\n|textStyle| TextStyle | TextStyle applied to the widget button |\n|padding| EdgeInsetsGeometry | the padding applied to the button |\n|showCountryOnly| bool | true if you want to see only the countries in the selection dialog |\n|searchDecoration| InputDecoration | decoration applied to the TextField search widget |\n|searchStyle| TextStyle | style applied to the TextField search widget text |\n|emptySearchBuilder| WidgetBuilder | use this to customize the widget used when the search returns 0 elements |\n|builder| Function(CountryCode) | use this to build a custom widget instead of the default FlatButton |\n|enabled| bool | set to false to disable the widget |\n|textOverflow| TextOverflow | the button text overflow behaviour |\n|dialogSize| Size | the size of the selection dialog |\n|countryFilter| List\u003cString\u003e | uses a list of strings to filter a sublist of countries |\n|showOnlyCountryWhenClosed| bool | if true it'll show only the country |\n|alignLeft| bool | aligns the flag and the Text to the left |\n|showFlag| bool | shows the flag everywhere |\n|showFlagMain| bool | shows the flag only when closed |\n|showFlagDialog| bool | shows the flag only in dialog |\n|flagWidth| double | the width of the flags |\n|flagDecoration| Decoration | used for styling the flags |\n|comparator| Comparator\u003cCountryCode\u003e | use this to sort the countries in the selection dialog |\n|hideSearch| bool | if true the search feature will be disabled |\n\n## Contributions\n\nContributions of any kind are more than welcome! Feel free to fork and improve country_code_picker in any way you want, make a pull request, or open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtoori%2FCountryCodePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimtoori%2FCountryCodePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtoori%2FCountryCodePicker/lists"}