Skip to content

A simple Dart library to convert state names to abbreviations and vice-versa

License

Notifications You must be signed in to change notification settings

write2varun/states_and_ut_india

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Buy Me A Coffee

states_and_ut_india

A simple Dart library to convert state names to abbreviations and vice-versa

Installation

Add the following to dependencies section in your pubspec.yml:

states_and_ut_india: ^1.0.1

Usage

Note

  • All methods that take a string are case-insensitive.

Get a state's abbreviation from name

Returns empty string if not found.

INStates.getAbbreviation("Karnataka");
// returns "KA"

Get a state's name from an abbreviation

Returns empty string if not found.

INStates.getName("KA");
// returns "Karnataka"

Get a list of all state abbreviations

INStates.getAllAbbreviationsList();
// returns ["AP", "AN", ...]

Get a list of all state names

INStates.getAllStateNamesList();
// returns ["Andhra Pradesh", "Andaman and Nicobar Islands", ...]

Get a map with state abbreviations as keys and names as values

INStates.getAbbreviationMap();
// returns {"AP": "Andhra Pradesh",  "AN": "Andaman and Nicobar Islands", ...}

Get a map with state names as keys and abbreviations as values

INStates.getNameMap();
// returns {"Andhra Pradesh": "AP", "Andaman and Nicobar Islands": "AN", ...}

Note

About

A simple Dart library to convert state names to abbreviations and vice-versa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published