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

MultiSelectChipDisplay : custom icon doesn't replace default icon(Icons.checked). #189

Open
director2010s opened this issue Aug 29, 2023 · 5 comments

Comments

@director2010s
Copy link

Please check screenshot for my UI.
https://prnt.sc/nEmSOC_ZxUgg

remove icon and checked icon is overlapped.
checked icon should be removed, but it is still existing with remove icon together.

MultiSelectChipDisplay(
items: provider.arrSavedPromoters.map((e) => MultiSelectItem(e, e.username)).toList(),
icon: const Icon( Icons.highlight_remove, color: Colors.red,),
// icon: const Icon( Icons.check, color: Colors.red,),
chipColor: Colors.green,
textStyle: const TextStyle(color: Colors.black),
onTap: (item) {
provider.onRemoveAddedPromoter(item.paymail);
},),

@florentin89
Copy link

florentin89 commented Jan 4, 2024

I have the same problem as Razvan (director2010s) have. I can't use a custom Icon for MultiSelectChipDisplay. Did anyone found a solution for this bug ?
I'm thinking to clone the multi_select_flutter library -> after to change the icon in the cloned location and later on to link the local library into Pubspec file just to fix this issue.

@alex-dh-kim
Copy link

you can add value (showCheckmark: false) at ChoiceChip in MultiSelectChipDisplay

@florentin89
Copy link

you can add value (showCheckmark: false) at ChoiceChip in MultiSelectChipDisplay

Hi @alex-dh-kim , I can't find anywhere that option. Can you guide me please how to access that showCheckmark option ? I have the latest version of the plugin.
Here is my code:

MultiSelectDialogField(
                      searchable: true,
                      initialValue: _selectedOptionsList,
                      items: _optionsList
                          .map((OptionModel option) =>
                              MultiSelectItem<OptionModel>(option, option.name ?? ""))
                          .toList(),
                      title: const Text("Select Option"),
                      selectedColor: Colors.blue,
                      decoration: const BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(40))),
                      buttonIcon: const Icon(Icons.checklist,color: Colors.blue),
                      buttonText: const Text("My Options",style: TextStyle(fontSize: 14)),
                      onConfirm: (selectedList) {
                        setState(() => _selectedOptionsList = selectedList.cast<OptionModel>()
                        );
                      },
                      chipDisplay: MultiSelectChipDisplay(
                        onTap: (selectedChip) {
                          setState(() => _selectedOptionsList.remove(selectedChip));
                          return _selectedOptionsList;
                        },
                      ),
                      itemsTextStyle: TextStyle(color: isDarkMode ? AppColors.contentColorWhite : AppColors.contentColorBlack),
                      selectedItemsTextStyle: TextStyle( color: isDarkMode ? AppColors.contentColorWhite : AppColors.contentColorBlack),
                      )

@alex-dh-kim
Copy link

@florentin89 I mean, you can find ChoiceChip Widget in MultiSelectChipDisplay Widget.( you should find _buildItem function in MultiSelectChipDisplay (line 132)
I'm using version 4.1.3 (multi_select_flutter: ^4.1.3)
hope this helps

(multi_select_chip_display.dart)
  Widget _buildItem(MultiSelectItem<V> item, BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(2.0),
      child: ChoiceChip(
        shape: shape as OutlinedBorder?,
        showCheckmark: false, // <----- add this key:value
        avatar: icon != null
        ....

@JulianWijst
Copy link

For now you can just add

chipTheme: ChipThemeData(
        showCheckmark: false,
      ),

To your ThemeData in MaterialApp

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

4 participants