country-list-pick icon indicating copy to clipboard operation
country-list-pick copied to clipboard

country cannot be selected when you use the pickerBuilder and countryBuilder paramters together.

Open dubemezeagwu opened this issue 2 years ago • 2 comments

When I use the pickerBuilder parameter to build the widget for the picker, before the country list fragment displays for picking the country, I can select a country. But when I use the countryBuilder to customize it. I cant select a country again.

dubemezeagwu avatar Aug 08 '22 08:08 dubemezeagwu

same problem

AmremadDev avatar Nov 15 '22 22:11 AmremadDev

This might be late as the issue was opened 2 years ago but this is what i did

countryBuilder: (context, countryCode) { return _buildCountryListItem(context, countryCode); }

Widget _buildCountryListItem(BuildContext context, CountryCode countryCode) { return Container( height: 50, color: Colors.white, child: Material( color: Colors.transparent, child: ListTile( leading: Image.asset( countryCode.flagUri!, package: 'country_list_pick', width: 30.0, ), title: Row( mainAxisSize: MainAxisSize.min, children: [ Text(countryCode.name!), const SizedBox(width: 10), Text('(${countryCode.dialCode!})'), ], ), onTap: () => Navigator.pop(context, countryCode), ), ), ); }

By adding Navigator.pop(context, countryCode)

TheinvinciblePrints avatar Mar 26 '24 06:03 TheinvinciblePrints