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

How to control the distance between country flag and code? #29

Open
mo7amedaliEbaid opened this issue Jan 25, 2024 · 1 comment
Open

Comments

@mo7amedaliEbaid
Copy link

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

                          showCountryOnly: false,
                          showFlag: true,
                        ),

countrypicker

@mo7amedaliEbaid mo7amedaliEbaid changed the title How to control the padding between country flag and code? How to control the distance between country flag and code? Jan 25, 2024
@zeeshan0080
Copy link

zeeshan0080 commented Mar 9, 2024

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)
                                    ],
                                  ),
                                );
                              }

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

No branches or pull requests

2 participants