Skip to content

getting both the localized name and the English name of the country #105

Answered by ShawermaBox
ShawermaBox asked this question in Q&A
Discussion options

You must be logged in to vote

solved it, you can use:

ElevatedButton(
          key: const Key('signupForm_nationalityInput_textField'),
          style: ButtonStyle(
              backgroundColor: MaterialStateProperty.all(Colors.white)),
          onPressed: () {
            showCountryPicker(
              context: context,
              showPhoneCode: false,

              onSelect: (Country country) {
                setState(() {
                  nationalityName = country.name;
                });            
 ////////////////////////////////////////////////////////////////////////////
                //get the English string
                print(CountryLocalizations(const Locale('en'))
                    .co…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ShawermaBox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant