jeudi 27 mai 2021

I am using country_code_picker 2.0.1 in flutter web application. Initial selection doesnt work

I am using country_code_picker 2.0.1 in flutter web application. For the initial selection, i am using the country names stored in the database.Doesn't work.

CountryCodePicker(
                                              onChanged: (CountryCode
                                                  countryCode) {
                                                _countryOrigin = countryCode
                                                    .name
                                                    .toString();
                                              },
                                              alignLeft: true,
                                              initialSelection:
                                                  result.countryOrigin ==
                                                          null
                                                      ? ''
                                                      : result.countryOrigin
                                                          .substring(0, 2)
                                                          .toUpperCase()
                                                          .toString(),
                                              favorite: [
                                                '+65',
                                                '+62',
                                                '+86',
                                                '+81',
                                                '+66',
                                                '+82',
                                                '+1',
                                                '+91',
                                              ],
                                              showCountryOnly: true,
                                              enabled: true,
                                              showFlag: true,
                                              showOnlyCountryWhenClosed:
                                                  true),



Aucun commentaire:

Enregistrer un commentaire