Coder Social home page Coder Social logo

countries_utils's Introduction

countries_utils

enter image description here enter image description here enter image description here enter image description here

A lite dart package for providing offline World Countires Data with helpful utils to your dart or flutter application

[note] : this packege it migrated from the old flutter_countries name to countries_utils to make it suitable for all dart projects with no flutter dependecy.

Installation

depend on the package in your pubspec.yaml

dependencies:
    countries_utils: <last_version>

get the packages :

flutter pub get

Parameters

This is a list of the properties that can be provided for each country

Parameter Return Type Output Example
name String Egypt
nativeName TranslationList جمهورية مصر العربية
translations TranslationList TranslationList(translations:List)
demonym String 'Egyptian'
altSpellings List [ "EG" , "Arab Republic of Egypt" ]
alpha2Code String EG
alpha3Code String EGY
numericCode String 818
topLevelDomain List ['.eg']
capital String Cairo
region String Africa
currnecies CurrencyList CurrencyList(currencies:List);
languages Map<String, dynamic> { 'eng' : 'English' , 'ara' : 'Arabic ' }
borders List ["LBY","PSE","SDN"]
area [in km] double 1002450.0
flags List ["https://restcountries.com/data/egy.svg","https://restcountries.com/data/png/egy.png"]
flagIcon String [🇪🇬]
phoneCode List +20
latitiude double 27
longitude double 30

Methods

This is a list of the methods you can get country data by :

Method Return Type Description Example
all() List get all countries data Countries.all()
byName() Country get country by name Countries.byName('Egypt')
byCode() Country get country by alpha2 code Countries.byCode('EG')
byAlph3Code() Country get country by alpha3 code Countries.byAlpha3Code('EGY')
byNumericCode() Country get country by numeric code Countries.byNumericCode('818')
byCallingCodes() Country get country by phone code Countries.byCallingCodes('+20')
byCapital() Country get country by capital Countries.byCapital('Cairo')
byFlag() Country get country by flag emoji Countries.byFlag('🇪🇬')
byLanguageCode() List get country by language code Countries.byLanguageCode('ara')
byLanguageName() List get country by language name Countries.byLanguageName('Arabic')
unMembers() List get UN Members countries Countries.unMembers()
byRegion() List get countries by region Countries.byRegion('Africa')
byArea() Country get countries by area Countries.byArea(1002450)
areaBiggerThan() List get countries Bigger than given area Countries.areaBiggerThan(1002450)
areaSmallerThan() List get countries Smaller than given area Countries.areaSmallerThan(1002450)

Development

Want to contribute? Great 😄 .. all good contributions to this package are welcome

Credit

thanks for amatos for the json country data

countries_utils's People

Contributors

egyleader avatar

Stargazers

 avatar Alexandre Richonnier avatar Dhari avatar Fethi avatar Ahmed Masoud  avatar  avatar

Watchers

 avatar Mahmoud Sherbeny avatar

countries_utils's Issues

Missing translations

Hello,

I've found some missing translations. Could you add:

"it": "Iran", => Iran (Islamic Republic of)
"it": "Kosovo", => Republic of Kosovo

Thank you.

Is it all ok with Russia and Republic of Kazakhstan?

There is phone codes [+73XX, +74XX, +75XX, +78XX, +79XX] and [+76XX, +77XX]
Is it necessary to have the XX part in suffixes? There are no countries with such codes and I really have no idea how to use this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.