us_states 1.0.0 copy "us_states: ^1.0.0" to clipboard
us_states: ^1.0.0 copied to clipboard

outdated

Simple Dart library to deal with state names and abbreviations.

us_states #

Simple library to deal with state names and abbreviations.

CircleCI

Installation #

Add the following to your pubspec.yml:

dependencies:
    us_states: ^1.0.0

Usage #

Note #

  • All methods that take a string are case-insensitive. No need to adjust case before passing string into a method.

Get a state's name from an abbreviation #

USStates.getName("IA");
// returns Iowa

Returns empty string if not found.

Get a state's abbreviation from name #

USStates.getAbbreviation("Iowa");
// returns IA

Returns empty string if not found.

Get a list of all state names #

USStates.getAllNames();

Get a list of all state abbreviations #

USStates.getAllAbbreviations();

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

USStates.getAbbreviationMap();

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

USStates.getAbbreviationMap();
12
likes
0
pub points
91%
popularity

Publisher

verified publisherwebb.engineer

Simple Dart library to deal with state names and abbreviations.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on us_states