Skip to content

Commit

Permalink
countries: show states for Mexico
Browse files Browse the repository at this point in the history
  • Loading branch information
deckerst committed Dec 19, 2024
1 parent 4685708 commit 67bdc50
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## <a id="unreleased"></a>[Unreleased]

### Added

- Countries: show states for Mexico

### Changed

- upgraded Flutter to stable v3.27.1
Expand Down
39 changes: 39 additions & 0 deletions lib/geo/states.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,68 @@ class GeoStates {
static final aus = CountryCode.AU.alpha2;
static final gbr = CountryCode.GB.alpha2;
static final ind = CountryCode.IN.alpha2;
static final mex = CountryCode.MX.alpha2;
static final usa = CountryCode.US.alpha2;

static final Set<String> stateCountryCodes = {
aus,
gbr,
ind,
mex,
usa,
};

static final stateCodesByCountryCode = {
aus: EmojiStateCodes.aus,
gbr: EmojiStateCodes.gbr,
ind: EmojiStateCodes.ind,
mex: EmojiStateCodes.mex,
usa: EmojiStateCodes.usa,
};

static const stateCodeByName = {
..._australiaEnglish,
..._indiaEnglish,
..._mexicoSpanish,
..._unitedKingdomEnglish,
..._unitedStatesEnglish,
};

static const _mexicoSpanish = {
'Aguascalientes': EmojiStateCodes.mxAguascalientes,
'Baja California': EmojiStateCodes.mxBajaCalifornia,
'Baja California Sur': EmojiStateCodes.mxBajaCaliforniaSur,
'Campeche': EmojiStateCodes.mxCampeche,
'Chiapas': EmojiStateCodes.mxChiapas,
'Chihuahua': EmojiStateCodes.mxChihuahua,
'Ciudad de México': EmojiStateCodes.mxCiudadDeMexico,
'Coahuila': EmojiStateCodes.mxCoahuila,
'Colima': EmojiStateCodes.mxColima,
'Durango': EmojiStateCodes.mxDurango,
'Guanajuato': EmojiStateCodes.mxGuanajuato,
'Guerrero': EmojiStateCodes.mxGuerrero,
'Hidalgo': EmojiStateCodes.mxHidalgo,
'Jalisco': EmojiStateCodes.mxJalisco,
'Estado de México': EmojiStateCodes.mxMexicoState,
'Michoacán': EmojiStateCodes.mxMichoacan,
'Morelos': EmojiStateCodes.mxMorelos,
'Nayarit': EmojiStateCodes.mxNayarit,
'Nuevo León': EmojiStateCodes.mxNuevoLeon,
'Oaxaca': EmojiStateCodes.mxOaxaca,
'Puebla': EmojiStateCodes.mxPuebla,
'Querétaro': EmojiStateCodes.mxQueretaro,
'Quintana Roo': EmojiStateCodes.mxQuintanaRoo,
'San Luis Potosí': EmojiStateCodes.mxSanLuisPotosi,
'Sinaloa': EmojiStateCodes.mxSinaloa,
'Sonora': EmojiStateCodes.mxSonora,
'Tabasco': EmojiStateCodes.mxTabasco,
'Tamaulipas': EmojiStateCodes.mxTamaulipas,
'Tlaxcala': EmojiStateCodes.mxTlaxcala,
'Veracruz': EmojiStateCodes.mxVeracruz,
'Yucatán': EmojiStateCodes.mxYucatan,
'Zacatecas': EmojiStateCodes.mxZacatecas,
};

static const _australiaEnglish = {
'Australian Capital Territory': EmojiStateCodes.auAustralianCapitalTerritory,
'New South Wales': EmojiStateCodes.auNewSouthWales,
Expand Down
69 changes: 69 additions & 0 deletions lib/ref/unicode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,75 @@ class EmojiStateCodes {
inWestBengal,
};

// MX
static const mxAguascalientes = 'mxagu';
static const mxBajaCalifornia = 'mxbcn';
static const mxBajaCaliforniaSur = 'mxbcs';
static const mxCampeche = 'mxcam';
static const mxChiapas = 'mxchp';
static const mxChihuahua = 'mxchh';
static const mxCiudadDeMexico = 'mxcmx';
static const mxCoahuila = 'mxcoa';
static const mxColima = 'mxcol';
static const mxDurango = 'mxdur';
static const mxGuanajuato = 'mxgua';
static const mxGuerrero = 'mxgro';
static const mxHidalgo = 'mxhid';
static const mxJalisco = 'mxjal';
static const mxMexicoState = 'mxmex';
static const mxMichoacan = 'mxmic';
static const mxMorelos = 'mxmor';
static const mxNayarit = 'mxnay';
static const mxNuevoLeon = 'mxnle';
static const mxOaxaca = 'mxoax';
static const mxPuebla = 'mxpue';
static const mxQueretaro = 'mxque';
static const mxQuintanaRoo = 'mxroo';
static const mxSanLuisPotosi = 'mxslp';
static const mxSinaloa = 'mxsin';
static const mxSonora = 'mxson';
static const mxTabasco = 'mxtab';
static const mxTamaulipas = 'mxtam';
static const mxTlaxcala = 'mxtla';
static const mxVeracruz = 'mxver';
static const mxYucatan = 'mxyuc';
static const mxZacatecas = 'mxzac';

static const mex = {
mxAguascalientes,
mxBajaCalifornia,
mxBajaCaliforniaSur,
mxCampeche,
mxChiapas,
mxChihuahua,
mxCiudadDeMexico,
mxCoahuila,
mxColima,
mxDurango,
mxGuanajuato,
mxGuerrero,
mxHidalgo,
mxJalisco,
mxMexicoState,
mxMichoacan,
mxMorelos,
mxNayarit,
mxNuevoLeon,
mxOaxaca,
mxPuebla,
mxQueretaro,
mxQuintanaRoo,
mxSanLuisPotosi,
mxSinaloa,
mxSonora,
mxTabasco,
mxTamaulipas,
mxTlaxcala,
mxVeracruz,
mxYucatan,
mxZacatecas,
};

// US
static const usAlabama = 'usal';
static const usAlaska = 'usak';
Expand Down

0 comments on commit 67bdc50

Please sign in to comment.