states_and_ut_india 1.0.1 copy "states_and_ut_india: ^1.0.1" to clipboard
states_and_ut_india: ^1.0.1 copied to clipboard

Simple Dart library to convert state names to abbreviations and vice-versa.

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 #

3
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Simple Dart library to convert state names to abbreviations and vice-versa.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on states_and_ut_india