| 1 | import 'package:cw_core/enumerable_item.dart'; |
| 2 | import 'package:collection/collection.dart'; |
| 3 | |
| 4 | class Country extends EnumerableItem<String> with Serializable<String> { |
| 5 | const Country({required String code, required this.fullName, required this.countryCode}) |
| 6 | : super(title: fullName, raw: code); |
| 7 | |
| 8 | final String fullName; |
| 9 | final String countryCode; |
| 10 | |
| 11 | static List<Country> get all => _all.values.toList(); |
| 12 | |
| 13 | static List<Country> get allForCakePay => _all.values |
| 14 | .where((element) => element.countryCode != 'EU' && element.countryCode != 'AQ') |
| 15 | .toList(); |
| 16 | |
| 17 | static const afghanistan = Country(code: 'afg', countryCode: 'AF', fullName: "Afghanistan"); |
| 18 | static const andorra = Country(code: 'and', countryCode: 'AD', fullName: "Andorra"); |
| 19 | static const angola = Country(code: 'ago', countryCode: 'AO', fullName: "Angola"); |
| 20 | static const anguilla = Country(code: 'aia', countryCode: 'AI', fullName: "Anguilla"); |
| 21 | static const antigua_and_barbuda = |
| 22 | Country(code: 'atg', countryCode: 'AG', fullName: "Antigua and Barbuda"); |
| 23 | static const are = Country(code: 'are', countryCode: 'AE', fullName: "United Arab Emirates"); |
| 24 | static const arg = Country(code: 'arg', countryCode: 'AR', fullName: "Argentina"); |
| 25 | static const arm = Country(code: 'arm', countryCode: 'AM', fullName: "Armenia"); |
| 26 | static const aruba = Country(code: 'abw', countryCode: 'AW', fullName: "Aruba"); |
| 27 | static const aus = Country(code: 'aus', countryCode: 'AU', fullName: "Australia"); |
| 28 | static const aut = Country(code: 'aut', countryCode: 'AT', fullName: "Austria"); |
| 29 | static const aze = Country(code: 'aze', countryCode: 'AZ', fullName: "Azerbaijan"); |
| 30 | static const belize = Country(code: 'blz', countryCode: 'BZ', fullName: "Belize"); |
| 31 | static const bfa = Country(code: 'bfa', countryCode: 'BF', fullName: "Burkina Faso"); |
| 32 | static const bel = Country(code: 'bel', countryCode: 'BE', fullName: "Belgium"); |
| 33 | static const bgd = Country(code: 'bgd', countryCode: 'BD', fullName: "Bangladesh"); |
| 34 | static const bhr = Country(code: 'bhr', countryCode: 'BH', fullName: "Bahrain"); |
| 35 | static const bhs = Country(code: 'bhs', countryCode: 'BS', fullName: "Bahamas"); |
| 36 | static const bhutan = Country(code: 'btn', countryCode: 'BT', fullName: "Bhutan"); |
| 37 | static const bol = Country(code: 'bol', countryCode: 'BO', fullName: "Bolivia"); |
| 38 | static const bra = Country(code: 'bra', countryCode: 'BR', fullName: "Brazil"); |
| 39 | static const brn = Country(code: 'brn', countryCode: 'BN', fullName: "Brunei"); |
| 40 | static const bwa = Country(code: 'bwa', countryCode: 'BW', fullName: "Botswana"); |
| 41 | static const cad = Country(code: 'cad', countryCode: 'CA', fullName: "Canada"); |
| 42 | static const che = Country(code: 'che', countryCode: 'CH', fullName: "Switzerland"); |
| 43 | static const chl = Country(code: 'chl', countryCode: 'CL', fullName: "Chile"); |
| 44 | static const chn = Country(code: 'chn', countryCode: 'CN', fullName: "China"); |
| 45 | static const col = Country(code: 'col', countryCode: 'CO', fullName: "Colombia"); |
| 46 | static const cri = Country(code: 'cri', countryCode: 'CR', fullName: "Costa Rica"); |
| 47 | static const cyp = Country(code: 'cyp', countryCode: 'CY', fullName: "Cyprus"); |
| 48 | static const czk = Country(code: 'czk', countryCode: 'CZ', fullName: "Czech Republic"); |
| 49 | static const deu = Country(code: 'deu', countryCode: 'DE', fullName: "Germany"); |
| 50 | static const dji = Country(code: 'dji', countryCode: 'DJ', fullName: "Djibouti"); |
| 51 | static const dnk = Country(code: 'dnk', countryCode: 'DK', fullName: "Denmark"); |
| 52 | static const dza = Country(code: 'dza', countryCode: 'DZ', fullName: "Algeria"); |
| 53 | static const ecu = Country(code: 'ecu', countryCode: 'EC', fullName: "Ecuador"); |
| 54 | static const egy = Country(code: 'egy', countryCode: 'EG', fullName: "Egypt"); |
| 55 | static const esp = Country(code: 'esp', countryCode: 'ES', fullName: "Spain"); |
| 56 | static const est = Country(code: 'est', countryCode: 'EE', fullName: "Estonia"); |
| 57 | static const eur = Country(code: 'eur', countryCode: 'EU', fullName: "European Union"); |
| 58 | static const fin = Country(code: 'fin', countryCode: 'FI', fullName: "Finland"); |
| 59 | static const fji = Country(code: 'fji', countryCode: 'FJ', fullName: "Fiji"); |
| 60 | static const flk = Country(code: 'flk', countryCode: 'FK', fullName: "Falkland Islands"); |
| 61 | static const fra = Country(code: 'fra', countryCode: 'FR', fullName: "France"); |
| 62 | static const fsm = Country(code: 'fsm', countryCode: 'FM', fullName: "Micronesia"); |
| 63 | static const gab = Country(code: 'gab', countryCode: 'GA', fullName: "Gabon"); |
| 64 | static const gbr = Country(code: 'gbr', countryCode: 'GB', fullName: "United Kingdom"); |
| 65 | static const geo = Country(code: 'geo', countryCode: 'GE', fullName: "Georgia"); |
| 66 | static const gha = Country(code: 'gha', countryCode: 'GH', fullName: "Ghana"); |
| 67 | static const grc = Country(code: 'grc', countryCode: 'GR', fullName: "Greece"); |
| 68 | static const grd = Country(code: 'grd', countryCode: 'GD', fullName: "Grenada"); |
| 69 | static const grl = Country(code: 'grl', countryCode: 'GL', fullName: "Greenland"); |
| 70 | static const gtm = Country(code: 'gtm', countryCode: 'GT', fullName: "Guatemala"); |
| 71 | static const guy = Country(code: 'guy', countryCode: 'GY', fullName: "Guyana"); |
| 72 | static const hkg = Country(code: 'hkg', countryCode: 'HK', fullName: "Hong Kong"); |
| 73 | static const hrv = Country(code: 'hrv', countryCode: 'HR', fullName: "Croatia"); |
| 74 | static const hun = Country(code: 'hun', countryCode: 'HU', fullName: "Hungary"); |
| 75 | static const idn = Country(code: 'idn', countryCode: 'ID', fullName: "Indonesia"); |
| 76 | static const ind = Country(code: 'ind', countryCode: 'IN', fullName: "India"); |
| 77 | static const irl = Country(code: 'irl', countryCode: 'IE', fullName: "Ireland"); |
| 78 | static const irn = Country(code: 'irn', countryCode: 'IR', fullName: "Iran"); |
| 79 | static const isl = Country(code: 'isl', countryCode: 'IS', fullName: "Iceland"); |
| 80 | static const isr = Country(code: 'isr', countryCode: 'IL', fullName: "Israel"); |
| 81 | static const ita = Country(code: 'ita', countryCode: 'IT', fullName: "Italy"); |
| 82 | static const jam = Country(code: 'jam', countryCode: 'JM', fullName: "Jamaica"); |
| 83 | static const jor = Country(code: 'jor', countryCode: 'JO', fullName: "Jordan"); |
| 84 | static const jpn = Country(code: 'jpn', countryCode: 'JP', fullName: "Japan"); |
| 85 | static const kaz = Country(code: 'kaz', countryCode: 'KZ', fullName: "Kazakhstan"); |
| 86 | static const ken = Country(code: 'ken', countryCode: 'KE', fullName: "Kenya"); |
| 87 | static const kir = Country(code: 'kir', countryCode: 'KI', fullName: "Kiribati"); |
| 88 | static const kor = Country(code: 'kor', countryCode: 'KR', fullName: "South Korea"); |
| 89 | static const kwt = Country(code: 'kwt', countryCode: 'KW', fullName: "Kuwait"); |
| 90 | static const lie = Country(code: 'lie', countryCode: 'LI', fullName: "Liechtenstein"); |
| 91 | static const lka = Country(code: 'lka', countryCode: 'LK', fullName: "Sri Lanka"); |
| 92 | static const ltu = Country(code: 'ltu', countryCode: 'LT', fullName: "Lithuania"); |
| 93 | static const lux = Country(code: 'lux', countryCode: 'LU', fullName: "Luxembourg"); |
| 94 | static const lva = Country(code: 'lva', countryCode: 'LV', fullName: "Latvia"); |
| 95 | static const mar = Country(code: 'mar', countryCode: 'MA', fullName: "Morocco"); |
| 96 | static const mex = Country(code: 'mex', countryCode: 'MX', fullName: "Mexico"); |
| 97 | static const mlt = Country(code: 'mlt', countryCode: 'MT', fullName: "Malta"); |
| 98 | static const mnp = Country(code: 'mnp', countryCode: 'MP', fullName: "Northern Mariana Islands"); |
| 99 | static const mtq = Country(code: 'mtq', countryCode: 'MQ', fullName: "Martinique"); |
| 100 | static const mys = Country(code: 'mys', countryCode: 'MY', fullName: "Malaysia"); |
| 101 | static const mwi = Country(code: 'mwi', countryCode: 'MW', fullName: "Malawi"); |
| 102 | static const nga = Country(code: 'nga', countryCode: 'NG', fullName: "Nigeria"); |
| 103 | static const niu = Country(code: 'niu', countryCode: 'NU', fullName: "Niue"); |
| 104 | static const nld = Country(code: 'nld', countryCode: 'NL', fullName: "Netherlands"); |
| 105 | static const nor = Country(code: 'nor', countryCode: 'NO', fullName: "Norway"); |
| 106 | static const nzl = Country(code: 'nzl', countryCode: 'NZ', fullName: "New Zealand"); |
| 107 | static const omn = Country(code: 'omn', countryCode: 'OM', fullName: "Oman"); |
| 108 | static const pak = Country(code: 'pak', countryCode: 'PK', fullName: "Pakistan"); |
| 109 | static const per = Country(code: 'per', countryCode: 'PE', fullName: "Peru"); |
| 110 | static const phl = Country(code: 'phl', countryCode: 'PH', fullName: "Philippines"); |
| 111 | static const pol = Country(code: 'pol', countryCode: 'PL', fullName: "Poland"); |
| 112 | static const pri = Country(code: 'pri', countryCode: 'PR', fullName: "Puerto Rico"); |
| 113 | static const prt = Country(code: 'prt', countryCode: 'PT', fullName: "Portugal"); |
| 114 | static const qat = Country(code: 'qat', countryCode: 'QA', fullName: "Qatar"); |
| 115 | static const rou = Country(code: 'rou', countryCode: 'RO', fullName: "Romania"); |
| 116 | static const rus = Country(code: 'rus', countryCode: 'RU', fullName: "Russia"); |
| 117 | static const saf = Country(code: 'saf', countryCode: 'ZA', fullName: "South Africa"); |
| 118 | static const sau = Country(code: 'sau', countryCode: 'SA', fullName: "Saudi Arabia"); |
| 119 | static const sgp = Country(code: 'sgp', countryCode: 'SG', fullName: "Singapore"); |
| 120 | static const slb = Country(code: 'slb', countryCode: 'SB', fullName: "Solomon Islands"); |
| 121 | static const svk = Country(code: 'svk', countryCode: 'SK', fullName: "Slovakia"); |
| 122 | static const svn = Country(code: 'svn', countryCode: 'SI', fullName: "Slovenia"); |
| 123 | static const swe = Country(code: 'swe', countryCode: 'SE', fullName: "Sweden"); |
| 124 | static const tha = Country(code: 'tha', countryCode: 'TH', fullName: "Thailand"); |
| 125 | static const tkm = Country(code: 'tkm', countryCode: 'TM', fullName: "Turkmenistan"); |
| 126 | static const ton = Country(code: 'ton', countryCode: 'TO', fullName: "Tonga"); |
| 127 | static const tur = Country(code: 'tur', countryCode: 'TR', fullName: "Turkey"); |
| 128 | static const tuv = Country(code: 'tuv', countryCode: 'TV', fullName: "Tuvalu"); |
| 129 | static const twn = Country(code: 'twn', countryCode: 'TW', fullName: "Taiwan"); |
| 130 | static const ukr = Country(code: 'ukr', countryCode: 'UA', fullName: "Ukraine"); |
| 131 | static const ury = Country(code: 'ury', countryCode: 'UY', fullName: "Uruguay"); |
| 132 | static const usa = Country(code: 'usa', countryCode: 'US', fullName: "USA"); |
| 133 | static const ven = Country(code: 'ven', countryCode: 'VE', fullName: "Venezuela"); |
| 134 | static const vnm = Country(code: 'vnm', countryCode: 'VN', fullName: "Vietnam"); |
| 135 | static const vut = Country(code: 'vut', countryCode: 'VU', fullName: "Vanuatu"); |
| 136 | static const btn = Country(code: 'btn', countryCode: 'BT', fullName: "Bhutan"); |
| 137 | static const bgr = Country(code: 'bgr', countryCode: 'BG', fullName: "Bulgaria"); |
| 138 | static const guf = Country(code: 'guf', countryCode: 'GF', fullName: "French Guiana"); |
| 139 | static const bes = Country(code: 'bes', countryCode: 'BQ', fullName: "Caribbean Netherlands"); |
| 140 | static const fro = Country(code: 'fro', countryCode: 'FO', fullName: "Faroe Islands"); |
| 141 | static const cuw = Country(code: 'cuw', countryCode: 'CW', fullName: "Curacao"); |
| 142 | static const msr = Country(code: 'msr', countryCode: 'MS', fullName: "Montserrat"); |
| 143 | static const cpv = Country(code: 'cpv', countryCode: 'CV', fullName: "Cabo Verde"); |
| 144 | static const nfk = Country(code: 'nfk', countryCode: 'NF', fullName: "Norfolk Island"); |
| 145 | static const bmu = Country(code: 'bmu', countryCode: 'BM', fullName: "Bermuda"); |
| 146 | static const vat = Country(code: 'vat', countryCode: 'VA', fullName: "Vatican City"); |
| 147 | static const aia = Country(code: 'aia', countryCode: 'AI', fullName: "Anguilla"); |
| 148 | static const gum = Country(code: 'gum', countryCode: 'GU', fullName: "Guam"); |
| 149 | static const myt = Country(code: 'myt', countryCode: 'YT', fullName: "Mayotte"); |
| 150 | static const mrt = Country(code: 'mrt', countryCode: 'MR', fullName: "Mauritania"); |
| 151 | static const ggy = Country(code: 'ggy', countryCode: 'GG', fullName: "Guernsey"); |
| 152 | static const cck = Country(code: 'cck', countryCode: 'CC', fullName: "Cocos (Keeling) Islands"); |
| 153 | static const blz = Country(code: 'blz', countryCode: 'BZ', fullName: "Belize"); |
| 154 | static const cxr = Country(code: 'cxr', countryCode: 'CX', fullName: "Christmas Island"); |
| 155 | static const mco = Country(code: 'mco', countryCode: 'MC', fullName: "Monaco"); |
| 156 | static const ner = Country(code: 'ner', countryCode: 'NE', fullName: "Niger"); |
| 157 | static const jey = Country(code: 'jey', countryCode: 'JE', fullName: "Jersey"); |
| 158 | static const asm = Country(code: 'asm', countryCode: 'AS', fullName: "American Samoa"); |
| 159 | static const gmb = Country(code: 'gmb', countryCode: 'GM', fullName: "Gambia"); |
| 160 | static const dma = Country(code: 'dma', countryCode: 'DM', fullName: "Dominica"); |
| 161 | static const glp = Country(code: 'glp', countryCode: 'GP', fullName: "Guadeloupe"); |
| 162 | static const ggi = Country(code: 'ggi', countryCode: 'GI', fullName: "Gibraltar"); |
| 163 | static const cmr = Country(code: 'cmr', countryCode: 'CM', fullName: "Cameroon"); |
| 164 | static const atg = Country(code: 'atg', countryCode: 'AG', fullName: "Antigua and Barbuda"); |
| 165 | static const slv = Country(code: 'slv', countryCode: 'SV', fullName: "El Salvador"); |
| 166 | static const pyf = Country(code: 'pyf', countryCode: 'PF', fullName: "French Polynesia"); |
| 167 | static const iot = |
| 168 | Country(code: 'iot', countryCode: 'IO', fullName: "British Indian Ocean Territory"); |
| 169 | static const vir = Country(code: 'vir', countryCode: 'VI', fullName: "Virgin Islands (U.S.)"); |
| 170 | static const abw = Country(code: 'abw', countryCode: 'AW', fullName: "Aruba"); |
| 171 | static const ago = Country(code: 'ago', countryCode: 'AO', fullName: "Angola"); |
| 172 | static const afg = Country(code: 'afg', countryCode: 'AF', fullName: "Afghanistan"); |
| 173 | static const lbn = Country(code: 'lbn', countryCode: 'LB', fullName: "Lebanon"); |
| 174 | static const hmd = |
| 175 | Country(code: 'hmd', countryCode: 'HM', fullName: "Heard Island and McDonald Islands"); |
| 176 | static const cok = Country(code: 'cok', countryCode: 'CK', fullName: "Cook Islands"); |
| 177 | static const bvt = Country(code: 'bvt', countryCode: 'BV', fullName: "Bouvet Island"); |
| 178 | static const atf = |
| 179 | Country(code: 'atf', countryCode: 'TF', fullName: "French Southern Territories"); |
| 180 | static const eth = Country(code: 'eth', countryCode: 'ET', fullName: "Ethiopia"); |
| 181 | static const plw = Country(code: 'plw', countryCode: 'PW', fullName: "Palau"); |
| 182 | static const ata = Country(code: 'ata', countryCode: 'AQ', fullName: "Antarctica"); |
| 183 | |
| 184 | static final _all = { |
| 185 | Country.afghanistan.raw: Country.afghanistan, |
| 186 | Country.andorra.raw: Country.andorra, |
| 187 | Country.angola.raw: Country.angola, |
| 188 | Country.anguilla.raw: Country.anguilla, |
| 189 | Country.antigua_and_barbuda.raw: Country.antigua_and_barbuda, |
| 190 | Country.are.raw: Country.are, |
| 191 | Country.arg.raw: Country.arg, |
| 192 | Country.arm.raw: Country.arm, |
| 193 | Country.aruba.raw: Country.aruba, |
| 194 | Country.aus.raw: Country.aus, |
| 195 | Country.aut.raw: Country.aut, |
| 196 | Country.aze.raw: Country.aze, |
| 197 | Country.belize.raw: Country.belize, |
| 198 | Country.bfa.raw: Country.bfa, |
| 199 | Country.bel.raw: Country.bel, |
| 200 | Country.bgd.raw: Country.bgd, |
| 201 | Country.bhr.raw: Country.bhr, |
| 202 | Country.bhs.raw: Country.bhs, |
| 203 | Country.bhutan.raw: Country.bhutan, |
| 204 | Country.bol.raw: Country.bol, |
| 205 | Country.bra.raw: Country.bra, |
| 206 | Country.brn.raw: Country.brn, |
| 207 | Country.bwa.raw: Country.bwa, |
| 208 | Country.cad.raw: Country.cad, |
| 209 | Country.che.raw: Country.che, |
| 210 | Country.chl.raw: Country.chl, |
| 211 | Country.chn.raw: Country.chn, |
| 212 | Country.col.raw: Country.col, |
| 213 | Country.cri.raw: Country.cri, |
| 214 | Country.cyp.raw: Country.cyp, |
| 215 | Country.czk.raw: Country.czk, |
| 216 | Country.deu.raw: Country.deu, |
| 217 | Country.dji.raw: Country.dji, |
| 218 | Country.dnk.raw: Country.dnk, |
| 219 | Country.dza.raw: Country.dza, |
| 220 | Country.ecu.raw: Country.ecu, |
| 221 | Country.egy.raw: Country.egy, |
| 222 | Country.esp.raw: Country.esp, |
| 223 | Country.est.raw: Country.est, |
| 224 | Country.eur.raw: Country.eur, |
| 225 | Country.fin.raw: Country.fin, |
| 226 | Country.fji.raw: Country.fji, |
| 227 | Country.flk.raw: Country.flk, |
| 228 | Country.fra.raw: Country.fra, |
| 229 | Country.fsm.raw: Country.fsm, |
| 230 | Country.gab.raw: Country.gab, |
| 231 | Country.gbr.raw: Country.gbr, |
| 232 | Country.geo.raw: Country.geo, |
| 233 | Country.gha.raw: Country.gha, |
| 234 | Country.grc.raw: Country.grc, |
| 235 | Country.grd.raw: Country.grd, |
| 236 | Country.grl.raw: Country.grl, |
| 237 | Country.gtm.raw: Country.gtm, |
| 238 | Country.guy.raw: Country.guy, |
| 239 | Country.hkg.raw: Country.hkg, |
| 240 | Country.hrv.raw: Country.hrv, |
| 241 | Country.hun.raw: Country.hun, |
| 242 | Country.idn.raw: Country.idn, |
| 243 | Country.ind.raw: Country.ind, |
| 244 | Country.irl.raw: Country.irl, |
| 245 | Country.irn.raw: Country.irn, |
| 246 | Country.isl.raw: Country.isl, |
| 247 | Country.isr.raw: Country.isr, |
| 248 | Country.ita.raw: Country.ita, |
| 249 | Country.jam.raw: Country.jam, |
| 250 | Country.jor.raw: Country.jor, |
| 251 | Country.jpn.raw: Country.jpn, |
| 252 | Country.kaz.raw: Country.kaz, |
| 253 | Country.ken.raw: Country.ken, |
| 254 | Country.kir.raw: Country.kir, |
| 255 | Country.kor.raw: Country.kor, |
| 256 | Country.kwt.raw: Country.kwt, |
| 257 | Country.lie.raw: Country.lie, |
| 258 | Country.lka.raw: Country.lka, |
| 259 | Country.ltu.raw: Country.ltu, |
| 260 | Country.lux.raw: Country.lux, |
| 261 | Country.lva.raw: Country.lva, |
| 262 | Country.mar.raw: Country.mar, |
| 263 | Country.mex.raw: Country.mex, |
| 264 | Country.mlt.raw: Country.mlt, |
| 265 | Country.mnp.raw: Country.mnp, |
| 266 | Country.mtq.raw: Country.mtq, |
| 267 | Country.mys.raw: Country.mys, |
| 268 | Country.mwi.raw: Country.mwi, |
| 269 | Country.nga.raw: Country.nga, |
| 270 | Country.niu.raw: Country.niu, |
| 271 | Country.nld.raw: Country.nld, |
| 272 | Country.nor.raw: Country.nor, |
| 273 | Country.nzl.raw: Country.nzl, |
| 274 | Country.omn.raw: Country.omn, |
| 275 | Country.pak.raw: Country.pak, |
| 276 | Country.per.raw: Country.per, |
| 277 | Country.phl.raw: Country.phl, |
| 278 | Country.pol.raw: Country.pol, |
| 279 | Country.pri.raw: Country.pri, |
| 280 | Country.prt.raw: Country.prt, |
| 281 | Country.qat.raw: Country.qat, |
| 282 | Country.rou.raw: Country.rou, |
| 283 | Country.rus.raw: Country.rus, |
| 284 | Country.saf.raw: Country.saf, |
| 285 | Country.sau.raw: Country.sau, |
| 286 | Country.sgp.raw: Country.sgp, |
| 287 | Country.slb.raw: Country.slb, |
| 288 | Country.svk.raw: Country.svk, |
| 289 | Country.svn.raw: Country.svn, |
| 290 | Country.swe.raw: Country.swe, |
| 291 | Country.tha.raw: Country.tha, |
| 292 | Country.tkm.raw: Country.tkm, |
| 293 | Country.ton.raw: Country.ton, |
| 294 | Country.tur.raw: Country.tur, |
| 295 | Country.tuv.raw: Country.tuv, |
| 296 | Country.twn.raw: Country.twn, |
| 297 | Country.ukr.raw: Country.ukr, |
| 298 | Country.ury.raw: Country.ury, |
| 299 | Country.usa.raw: Country.usa, |
| 300 | Country.ven.raw: Country.ven, |
| 301 | Country.vnm.raw: Country.vnm, |
| 302 | Country.vut.raw: Country.vut, |
| 303 | Country.btn.raw: Country.btn, |
| 304 | Country.bgr.raw: Country.bgr, |
| 305 | Country.guf.raw: Country.guf, |
| 306 | Country.bes.raw: Country.bes, |
| 307 | Country.fro.raw: Country.fro, |
| 308 | Country.cuw.raw: Country.cuw, |
| 309 | Country.msr.raw: Country.msr, |
| 310 | Country.cpv.raw: Country.cpv, |
| 311 | Country.nfk.raw: Country.nfk, |
| 312 | Country.bmu.raw: Country.bmu, |
| 313 | Country.vat.raw: Country.vat, |
| 314 | Country.aia.raw: Country.aia, |
| 315 | Country.gum.raw: Country.gum, |
| 316 | Country.myt.raw: Country.myt, |
| 317 | Country.mrt.raw: Country.mrt, |
| 318 | Country.ggy.raw: Country.ggy, |
| 319 | Country.cck.raw: Country.cck, |
| 320 | Country.blz.raw: Country.blz, |
| 321 | Country.cxr.raw: Country.cxr, |
| 322 | Country.mco.raw: Country.mco, |
| 323 | Country.ner.raw: Country.ner, |
| 324 | Country.jey.raw: Country.jey, |
| 325 | Country.asm.raw: Country.asm, |
| 326 | Country.gmb.raw: Country.gmb, |
| 327 | Country.dma.raw: Country.dma, |
| 328 | Country.glp.raw: Country.glp, |
| 329 | Country.ggi.raw: Country.ggi, |
| 330 | Country.cmr.raw: Country.cmr, |
| 331 | Country.atg.raw: Country.atg, |
| 332 | Country.slv.raw: Country.slv, |
| 333 | Country.pyf.raw: Country.pyf, |
| 334 | Country.iot.raw: Country.iot, |
| 335 | Country.vir.raw: Country.vir, |
| 336 | Country.abw.raw: Country.abw, |
| 337 | Country.ago.raw: Country.ago, |
| 338 | Country.afg.raw: Country.afg, |
| 339 | Country.lbn.raw: Country.lbn, |
| 340 | Country.hmd.raw: Country.hmd, |
| 341 | Country.cok.raw: Country.cok, |
| 342 | Country.bvt.raw: Country.bvt, |
| 343 | Country.atf.raw: Country.atf, |
| 344 | Country.eth.raw: Country.eth, |
| 345 | Country.plw.raw: Country.plw, |
| 346 | Country.ata.raw: Country.ata, |
| 347 | }; |
| 348 | |
| 349 | static final Map<String, String> _cakePayNames = { |
| 350 | 'Slovak Republic': 'Slovakia', |
| 351 | 'Brunei Darussalam': 'Brunei', |
| 352 | 'Federated States of Micronesia': 'Micronesia', |
| 353 | 'Sri lanka': 'Sri Lanka', |
| 354 | 'UAE': 'United Arab Emirates', |
| 355 | 'UK': 'United Kingdom', |
| 356 | 'Curaçao': "Curacao", |
| 357 | }; |
| 358 | |
| 359 | static String normalizeName(String name) { |
| 360 | final key = name.trim(); |
| 361 | return _cakePayNames[key] ?? key; |
| 362 | } |
| 363 | |
| 364 | static Country deserialize({required String raw}) => _all[raw]!; |
| 365 | |
| 366 | static Country? fromCode(String countryCode) { |
| 367 | return _all.values.firstWhereOrNull((element) => element.raw == countryCode.toLowerCase()); |
| 368 | } |
| 369 | |
| 370 | static Country? fromCountryCode(String countryCode) { |
| 371 | return _all.values |
| 372 | .firstWhereOrNull((element) => element.countryCode == countryCode.toUpperCase()); |
| 373 | } |
| 374 | |
| 375 | @override |
| 376 | bool operator ==(Object other) => other is Country && other.raw == raw; |
| 377 | |
| 378 | @override |
| 379 | int get hashCode => raw.hashCode ^ title.hashCode; |
| 380 | |
| 381 | String get iconPath => "assets/images/flags/$raw.png"; |
| 382 | } |