Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ICAO 9303 Nationality codes #100

Merged
merged 4 commits into from Dec 2, 2022

Conversation

JSenart
Copy link
Contributor

@JSenart JSenart commented Nov 30, 2022

According to Norm ICAO 9303, nationality codes are defined for machine readable documents with these specifications
https://www.icao.int/publications/Documents/9303_p3_cons_en.pdf
These are the codes stated in official documents MRZs.

Added them here as this is the most prominent country picker package that I would like to use for country picking in tourist forms to be submitted to immigration services.

@JSenart
Copy link
Contributor Author

JSenart commented Nov 30, 2022

I can also remove the codes from subject countries and create a new mode of country picker where only the Nationalities are shown (There are less nationalities than countries). I wanted however to make minimal changes to your repo and your approval before making such adition.

@Daniel-Ioannou Daniel-Ioannou merged commit c869fee into Daniel-Ioannou:master Dec 2, 2022
@Daniel-Ioannou
Copy link
Owner

@JSenart First thank you for your contribution.

I originally approved and merged this pull request but after I run the example project I saw that the package through an exception.

At Country mode you implemented ICAO 9303 field as not nullable but at country_codes.dart you did not provide the ICAO 9303 for all countries.

Please fix the errors and reopen the pull request.

type 'Null' is not a subtype of type 'String'

The relevant error-causing widget was: 
  Container Container:file:flutter/package/country_picker/lib/src/country_list_bottom_sheet.dart:74:10
When the exception was thrown, this was the stack: 
#0      new Country.from (package:country_picker/src/country.dart:89:18)
#1      new CountryService.<anonymous closure> (package:country_picker/src/country_service.dart:11:51)
#2      MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#3      ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#4      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#6      new List.of (dart:core-patch/array_patch.dart:51:28)
#7      ListIterable.toList (dart:_internal/iterable.dart:213:44)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants