Giter VIP home page Giter VIP logo

us_states's Introduction

us_states

Simple Dart library to deal with state names and abbreviations.

CircleCI

Installation

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

  us_states: ^1.2.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

Returns null if not found.

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

Get a state's abbreviation from name

Returns null if not found.

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

Get a list of all state names

USStates.getAllNames();
// returns ["Alaska", "Alabama", ...]

Get a list of all state abbreviations

USStates.getAllAbbreviations();
// returns ["AK", "AL", ...]

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

USStates.getAbbreviationMap();
// returns {"AK": "Alaska", "AL": "Alabama", ...}

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

USStates.getNameMap();
// returns {"Alaska": "AK", "Alabama": "AL", ...}

us_states's People

Contributors

cameronwebbable avatar mclark4386 avatar

Watchers

James Cloos avatar

Forkers

mclark4386

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.