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

Cant change Selected chip border color #103

Closed
rohanudhwani-blinkx opened this issue Jul 4, 2024 · 3 comments
Closed

Cant change Selected chip border color #103

rohanudhwani-blinkx opened this issue Jul 4, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rohanudhwani-blinkx
Copy link

`Widget _buildFilterButton(String filterName, String filterType, int index,
String orientation, List filterOptions) {
final bool isMobile = MediaQuery.of(context).size.width < 600;

if (filterType == 'text') {
  return _buildTextInputFilter(filterName);
}

final MultiSelectController _controller = MultiSelectController();
Timer? _hideDropdownTimer;
double totalSubfilterHeight = filterOptions.length * 40.0;
return MouseRegion(
  onHover: (event) {
    if (orientation == "horizontal") {
      _controller.showDropdown();
    }
  },
  child: Container(
    width: 150,
    height: 43,
    child: MultiSelectDropDown(
      borderRadius: 25,
      borderColor: Colors.grey,
      borderWidth: 0.8,
      hintColor: Theme.of(context).colorScheme.primary,
      fieldBackgroundColor: Theme.of(context).colorScheme.secondary,
      selectedOptionBackgroundColor: Color(0xFF52BDE2),
      optionTextStyle: TextStyle(
        color: Theme.of(context).colorScheme.primary,
        fontSize: isMobile ? 14 : 14,
      ),
      controller: _controller,
      onOptionSelected: (List<ValueItem> selectedOptions) {
        if (selectedOptions.isNotEmpty) {
          List<String> selectedLabels =
              selectedOptions.map((item) => item.label).toList();
          bool isAllSelected = selectedLabels.contains("ALL");
          if (isAllSelected) {
            // If "ALL" is selected, store it as the only option in the list
            selectedFilters[filterName] = ['ALL'];
          } else {
            // Store the selected options' labels as a list
            selectedFilters[filterName] = selectedLabels;
          }
          widget.onGoPressed(selectedFilters);
        }
      },
      hint: filterName,
      options: filterOptions.map<ValueItem>((subFilter) {
        final item = subFilter as String;
        return ValueItem(label: item, value: filterOptions.indexOf(item));
      }).toList(),
      selectionType: SelectionType.multi,
      chipConfig: const ChipConfig(
        backgroundColor: Color(0xFF60C2AC),
        // wrapType: WrapType.wrap,
      ),
      dropdownHeight: totalSubfilterHeight,
      selectedOptionIcon: const Icon(Icons.check_circle),
    ),
  ),
);

}`

image_2024-07-04_123248327

@savioalwd
Copy link

savioalwd commented Jul 29, 2024

Same issue here when this package used, chip background color changes, but the border cant be set to zero and a black color appears

I solved the issue by

  1. copy'package:multi_dropdown/widgets/selection_chip.dart' content into a new class and save somewhere
  2. navigate newly created selection_chip.dart file
  3. update the chip widget inside the build widget.
    • add shape props to chip.
      shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(chipConfig.radius),
      side:const BorderSide(
      color: Colors.transparent, // Set the border color to transparent
      width: 0, // Set the border width to 0
      ),
      ),
  4. save the file.
    4.goto multiselect_dropdown.dart file and replace the old selection_chip library path with the new one .

thats all

for the developer please add shape prop to the chip_config add to manage the border shape and others thankyou

@oi-narendra oi-narendra self-assigned this Aug 1, 2024
@oi-narendra oi-narendra added the enhancement New feature or request label Aug 1, 2024
@oi-narendra
Copy link
Owner

Added in Beta version.

@oi-narendra
Copy link
Owner

Please migrate to the latest version v3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants