android – the best way to repair the nation picker format please “flutter”


use this bundle country_picker. Which has a fields known as phoneCode.

TextField(
                  ornament: InputDecoration(
                    contentPadding: const EdgeInsets.symmetric(
                        vertical: 15.0, horizontal: 15),
                    enabledBorder: OutlineInputBorder(
                      borderRadius: BorderRadius.round(10),
                      borderSide: BorderSide(
                        shade: Colours.white,
                        width: 1,
                      ),
                    ),
                    prefixIcon: TextButton(
                      onPressed: () {
                        showCountryPicker(
                          context: context,
                          onSelect: (worth) {
                            setState(
                              () {
                                _selectedCountry = worth;
                              },
                            );
                          },
                        );
                      },
                      baby: Textual content(
                        "${_selectedCountry.flagEmoji} +${_selectedCountry.phoneCode}",
                      ),
                    ),
                    hintText: "Enter Telephone Quantity",
                    focusedBorder: OutlineInputBorder(
                      borderRadius: BorderRadius.round(10),
                    ),
                  ),
                ),

The preliminary worth of nation is ready as Afghanistan which is.

Nation _selectedCountry = Nation.from(
json: {
  "e164_cc": "93",
  "iso2_cc": "AF",
  "e164_sc": 0,
  "geographic": true,
  "degree": 1,
  "identify": "Afghanistan",
  "instance": "701234567",
  "display_name": "Afghanistan (AF) [+93]",
  "full_example_with_plus_sign": "+93701234567",
  "display_name_no_e164_cc": "Afghanistan (AF)",
  "e164_key": "93-AF-0"
});