chandrabezzo / CountryCodePicker

A flutter package for showing a country code selector.
MIT License
19 stars 70 forks source link

DropDown Arrow change functionality #42

Open Shvet opened 1 month ago

Shvet commented 1 month ago

If possible can add functionality to change drop down arrow? To just change arrow i need to user builder method. Also you may need to add how to show image in custom widget as we have to specify package name from where assets are being showing in this case.

Here is Example in which i have to waste my time to just find how to use flags from package's assets.

  CountryCodePicker(
                            showDropDownButton: true,
                            showFlagDialog: true,
                            showFlag: true,
                            initialSelection: '+91',
                            onChanged: (value) {},
                            padding: EdgeInsets.zero,
                            margin: EdgeInsets.zero,
                            builder: (countryCode) {
                              return Container(
                                padding: const EdgeInsets.all(8.0),
                                child: Row(
                                  children: [
                                    Image.asset(
                                      countryCode!.flagUri!,
                                      width: 36,
                                      height: 24,
                                      package: 'country_code_picker',
                                    ),
                                    const SizedBox(width: 4.0),
                                    Text(
                                      '${countryCode.code} ${countryCode.dialCode}',
                                      style: Theme.of(context)
                                          .textTheme
                                          .bodyLarge!
                                          .copyWith(fontWeight: FontWeight.w500),
                                    ),
                                    const SizedBox(width: 4.0),
                                    Icon(
                                      Icons.arrow_drop_down_circle_rounded,
                                      size: 18,
                                      color: AppColors.secondaryColor,
                                    ),
                                  ],
                                ),
                              );
                            },
                          ),

I have to manully write package name in Image.asset(package:) as there is no documents on customisation.