chandrabezzo/CountryCodePicker

How to control the distance between country flag and code?

Opened this issue · 1 comments

                CountryCodePicker(
                          onChanged: (code) {
                            setState(() {
                              selectedCountry = code;
                            });
                          },
                          initialSelection: 'EG',
                          favorite: const ['+20', 'EG'],
                          padding: EdgeInsets.zero,

                          showCountryOnly: false,
                          showFlag: true,
                        ),

countrypicker

You cannot, although you can use its builder to build custom UI with desired padding and stuff.
builder sample with flag and dropdown icon:

builder: (code){
                                return SizedBox(
                                  width: 90,
                                  child: Row(
                                    mainAxisAlignment: MainAxisAlignment.center,
                                    children: [
                                      Container(
                                        width: 35,
                                        height: 35,
                                        decoration: BoxDecoration(
                                          image: DecorationImage(
                                            image:
                                            AssetImage(code!.flagUri!, package: 'country_code_picker'),
                                          ),
                                        ),
                                      ),
                                      const Gap(6),
                                      const Icon(Icons.arrow_drop_down_outlined)
                                    ],
                                  ),
                                );
                              }