Search packages, repositories and app categories

Package detailsv1.3.1

us_states

Simple Dart library to deal with state names and abbreviations.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
28.7K
Likes
12
Pub points
160

Install package

flutter pub add us_states

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A simple Dart library for working with U.S. state names and their abbreviations. It provides easy access to state data, including full names, two-letter abbreviations, and other common mappings. Ideal for applications requiring state-based lookups, form validations, or address processing. The package is lightweight and supports all major platforms: Android, iOS, Web, macOS, Windows, and Linux. It is maintained by webb.engineer and hosted on GitHub for transparency and community contributions.

Use cases

  • Address form validation
  • State dropdown generation
  • Geographic data mapping
  • User location selection
  • Data normalization for U.S. states

Key features

  • Full state name to abbreviation lookup
  • Abbreviation to full name conversion
  • Support for all 50 U.S. states
  • Cross-platform compatibility
  • Lightweight and easy to integrate

Suitable for

  • Form handling apps
  • Location-based services
  • Data entry tools
  • Geographic information systems
  • Dart projects needing state data

Considerations

  • Limited to U.S. states only
  • No support for territories or counties
  • Requires manual updates for new state changes
  • Not suitable for international state data

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.3.1

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", ...}

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.

Rankings