{"id":32290781,"url":"https://github.com/intelryzen/world_info_plus","last_synced_at":"2025-10-23T02:57:26.326Z","repository":{"id":272638745,"uuid":"916120609","full_name":"intelryzen/world_info_plus","owner":"intelryzen","description":"Flutter package that provides detailed information about 250 countries, including dial codes, time zones, country codes, and localized country names based on the device's locale","archived":false,"fork":false,"pushed_at":"2025-02-09T07:15:09.000Z","size":4061,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T02:57:23.925Z","etag":null,"topics":["calling-codes","country","countrycode","dart","flutter","iso","iso3166","iso3166-1","iso3166-2","localization","timezone"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/world_info_plus","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intelryzen.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-13T13:51:36.000Z","updated_at":"2025-02-09T07:15:14.000Z","dependencies_parsed_at":"2025-01-15T19:58:01.403Z","dependency_job_id":"1afaae7f-b82e-4ade-bffe-df7acdae6e12","html_url":"https://github.com/intelryzen/world_info_plus","commit_stats":null,"previous_names":["intelryzen/world_info_plus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/intelryzen/world_info_plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelryzen%2Fworld_info_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelryzen%2Fworld_info_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelryzen%2Fworld_info_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelryzen%2Fworld_info_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intelryzen","download_url":"https://codeload.github.com/intelryzen/world_info_plus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelryzen%2Fworld_info_plus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280551633,"owners_count":26349597,"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","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["calling-codes","country","countrycode","dart","flutter","iso","iso3166","iso3166-1","iso3166-2","localization","timezone"],"created_at":"2025-10-23T02:57:21.652Z","updated_at":"2025-10-23T02:57:26.318Z","avatar_url":"https://github.com/intelryzen.png","language":"Dart","readme":"# World Info Plus Flutter Package\n\n[![pub package](https://img.shields.io/pub/v/world_info_plus.svg)](https://pub.dev/packages/world_info_plus)\n[![Score](https://img.shields.io/pub/points/world_info_plus?label=Score\u0026logo=dart)](https://pub.dev/packages/world_info_plus/score)\n[![Platform](https://img.shields.io/badge/Platform-Android%20|%20iOS%20|%20macOS%20|%20Web%20|%20Windows%20|%20Linux%20-blue.svg?logo=flutter)](https://pub.dev/packages/world_info_plus)\n![GitHub stars](https://img.shields.io/github/stars/intelryzen/world_info_plus)\n![GitHub forks](https://img.shields.io/github/forks/intelryzen/world_info_plus)\n![GitHub issues](https://img.shields.io/github/issues/intelryzen/world_info_plus)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/intelryzen/world_info_plus)\n\n`world_info_plus` is a Flutter package that provides detailed information about 250 countries across the globe. This includes **calling codes**, **time zones**, **country codes** (ISO Alpha-2/Alpha-3/numeric), and more. It also supports **localized country names** based on the device's locale or language code, if available.\n\n\u003cimg src=\"https://github.com/intelryzen/world_info_plus/blob/main/screenshots/demo.png?raw=true\" alt=\"demo\" width=\"250\"/\u003e\n\n---\n\n## Features\n\n- **Extensive Country Data**: Access up to 250 countries with details like capital, continent, currency, calling code, and time zone.\n- **Localization**: Automatically provides localized country names based on the user's device locale (or language fallback).\n- **Easy Integration**: Straightforward APIs to get all countries, retrieve device country, or fetch a specific country by its alpha2 code.\n- **Optional Localization Loading**: If you wish to use `localizedName`, just call the `initializeLocalizedName()` function in your `main` before running the app.\n\n---\n\n## Quick Start\n### Optional: Initialize Localized Names\nIf you **want to use** the localizedName field of each country, you **must** initialize localized names first. This will load the appropriate JSON for the device’s locale.\n\n```dart\nimport 'package:world_info_plus/world_info_plus.dart';\n\nvoid main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n  \n  // IMPORTANT: Call this to load localized country names, if you need them.\n  await initializeLocalizedName();\n\n  runApp(const MyApp());\n}\n```\n### Basic Usage\n```dart\n// Getting all countries\nList\u003cCountry\u003e countries = WorldInfoPlus.countries;\nprint('Total countries: ${countries.length}');\n\n// Getting the device locale\nLocale deviceLocale = WorldInfoPlus.deviceLocale;\nprint('Device Locale: ${deviceLocale.toString()}');\n\n// Getting the device country (based on device locale)\nCountry? deviceCountry = WorldInfoPlus.deviceCountry;\nprint('Device Country: ${deviceCountry?.name ?? \"Unknown\"}');\n\n// Fetching a specific country by alpha2 code (e.g., \"US\", \"KR\", \"FR\")\nCountry? countryUS = WorldInfoPlus.getCountryByAlpha2('US');\nprint('Country Name: ${countryUS?.name}');\nprint('Country Localized Name: ${countryUS?.localizedName ?? \"N/A\"}');\n```\n---\n## Public API\nThe `world_info_plus` library provides a set of static methods and properties through the `WorldInfoPlus` class:\n| **API**                                        | **Return Type**       | **Description**                                                                                      |\n|------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------|\n| `WorldInfoPlus.countries`                      | `List\u003cCountry\u003e`        | Returns a list of all available countries.                                                           |\n| `WorldInfoPlus.deviceLocale`                   | `Locale`               | The current device locale derived from `WidgetsBinding.instance.platformDispatcher.locale`.           |\n| `WorldInfoPlus.deviceCountry`                  | `Country?`             | Attempts to match the device's locale country code to a `Country`. Returns `null` if not found.       |\n| `WorldInfoPlus.getCountryByAlpha2(String alpha2)` | `Country?`             | Fetches a `Country` by its ISO Alpha-2 code (e.g., \"US\", \"FR\"). Returns `null` if not found.          |\n| `initializeLocalizedName()`                    | `Future\u003cvoid\u003e`         | Loads localized country names based on the device’s locale. Must be called **before** accessing `localizedName`. It is recommended to call this function in the `main` function before running the app. |\n\n---\n## Country Model\nEach country is represented by the `Country` class, containing the following fields:\n| **Property**        | **Type**                | **Description**                                                                                     |\n|---------------------|-------------------------|-----------------------------------------------------------------------------------------------------|\n| `name`              | `String`                | Official English name of the country (e.g., \"United States of America\").                            |\n| `shortName`         | `String`                | A shorter or common English name (e.g., \"USA\").                                           |\n| `nativeName`        | `String`                | Native name of the country in its primary local language.                                           |\n| `capital`           | `String`                | Name of the country’s capital city.                                                                 |\n| `continent`         | `String`                | Name of the continent (e.g., \"North America\", \"Asia\").                                              |\n| `currency`          | `String`                | The official currency code (e.g., \"Dollar\", \"Euro\").                                                    |\n| `callingCode`       | `String`                | Country calling code (e.g., \"1\" for the USA, \"82\" for South Korea).                                 |\n| `timeZoneInCapital` | `String`                | The primary time zone of the capital city (e.g., \"Asia/Seoul\").                                      |\n| `alpha2`            | `String`                | ISO Alpha-2 country code (e.g., \"US\", \"KR\").                                                        |\n| `alpha3`            | `String`                | ISO Alpha-3 country code (e.g., \"USA\", \"KOR\").                                                      |\n| `numeric`           | `String`                | ISO numeric country code (e.g., \"840\" for the USA).                                                 |\n| `tld`               | `String`                | Country’s top-level domain (e.g., \"us\", \"kr\").                                                    |\n| `fips`              | `String`                | Federal Information Processing Standards code.                                                      |\n| `localizedName`     | `String?`               | Localized name if `initializeLocalizedName()` was called; otherwise `null`.                         |\n| `extra`             | `Map\u003cString, dynamic\u003e?` | Additional information if available.                                                                |\n| `imagePath`         | `String`                | Path to the country’s flag image, e.g., `\"packages/world_info_plus/assets/flags/us.png\"`.           |\n\n**Example usage of** `Country`:\n```dart\nfinal country = WorldInfoPlus.getCountryByAlpha2('US');\nif (country != null) {\n  print('Name: ${country.name}');\n  print('Short Name: ${country.shortName}');\n  print('Localized Name: ${country.localizedName ?? \"No localized name loaded\"}');\n  print('Capital: ${country.capital}');\n  print('Continent: ${country.continent}');\n  print('Currency: ${country.currency}');\n  print('Calling Code: +${country.callingCode}');\n  print('TimeZone: ${country.timeZoneInCapital}');\n  print('Alpha2/Alpha3: ${country.alpha2} / ${country.alpha3}');\n  print('Numeric: ${country.numeric}');\n  print('TLD: ${country.tld}');\n  print('FIPS: ${country.fips}');\n  print('Image Path: ${country.imagePath}');\n  print('Extra Info: ${country.extra}');\n}\n```\n\n---\n## Contributions\nContributions are welcome! Please open **[issues](https://github.com/intelryzen/world_info_plus/issues)** and **[pull requests](https://github.com/intelryzen/world_info_plus/pulls)** to improve this package.\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelryzen%2Fworld_info_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintelryzen%2Fworld_info_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelryzen%2Fworld_info_plus/lists"}