Skip to content

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

Open

Description

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

                          showCountryOnly: false,
                          showFlag: true,
                        ),

countrypicker

Activity

  1. changed the title [-]How to control the padding between country flag and code?[/-] [+]How to control the distance between country flag and code?[/+] on Jan 25, 2024
  2. zeeshan0080 commented on Mar 9, 2024

    @zeeshan0080

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions