GFMultiSelect<T> constructor

const GFMultiSelect<T>({
  1. required List items,
  2. required ValueChanged<List> onSelect,
  3. List<int>? initialSelectedItemsIndex,
  4. String dropdownTitleTileText = 'Select : ',
  5. TextStyle dropdownTitleTileTextStyle = const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
  6. dynamic color,
  7. Widget? avatar,
  8. EdgeInsets padding = const EdgeInsets.all(5),
  9. EdgeInsets margin = const EdgeInsets.all(5),
  10. double size = GFSize.SMALL,
  11. GFCheckboxType type = GFCheckboxType.basic,
  12. Color activeBgColor = GFColors.WHITE,
  13. Color inactiveBgColor = GFColors.WHITE,
  14. Color activeBorderColor = GFColors.WHITE,
  15. Color inactiveBorderColor = GFColors.WHITE,
  16. Color? listItemTextColor = GFColors.DARK,
  17. Color buttonColor = GFColors.PRIMARY,
  18. Widget? submitButton,
  19. Widget? cancelButton,
  20. Widget expandedIcon = const Icon(Icons.keyboard_arrow_down, color: Colors.black87, size: 30),
  21. Widget collapsedIcon = const Icon(Icons.keyboard_arrow_up, color: Colors.black87, size: 30),
  22. FocusNode? focusNode,
  23. Color dropdownBgColor = Colors.white,
  24. Widget activeIcon = const Icon(Icons.check, size: 20, color: GFColors.DARK),
  25. Widget? inactiveIcon,
  26. Color customBgColor = GFColors.SUCCESS,
  27. bool selected = false,
  28. Border? dropdownTitleTileBorder,
  29. BorderRadius dropdownTitleTileBorderRadius = const BorderRadius.all(Radius.circular(4)),
  30. dynamic dropdownTitleTileColor = GFColors.WHITE,
  31. bool hideDropdownUnderline = false,
  32. BorderSide dropdownUnderlineBorder = const BorderSide(color: Colors.black45, width: 1),
  33. EdgeInsets dropdownTitleTileMargin = const EdgeInsets.all(16),
  34. EdgeInsets dropdownTitleTilePadding = const EdgeInsets.all(12),
  35. String? dropdownTitleTileHintText,
  36. TextStyle dropdownTitleTileHintTextStyle = const TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
  37. Widget? dropdownButton,
  38. Key? key,
})

GF Multiselect let user to select multiple items from the number of Checkbox ListTile items and display selected items in the TitleTile box. It displays list of items in the overlay dropdown fashion.

Implementation

const GFMultiSelect({
  required this.items,
  required this.onSelect,
  this.initialSelectedItemsIndex,
  this.dropdownTitleTileText = 'Select : ',
  this.dropdownTitleTileTextStyle =
      const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
  this.color,
  this.avatar,
  this.padding = const EdgeInsets.all(5),
  this.margin = const EdgeInsets.all(5),
  this.size = GFSize.SMALL,
  this.type = GFCheckboxType.basic,
  this.activeBgColor = GFColors.WHITE,
  this.inactiveBgColor = GFColors.WHITE,
  this.activeBorderColor = GFColors.WHITE,
  this.inactiveBorderColor = GFColors.WHITE,
  this.listItemTextColor = GFColors.DARK,
  this.buttonColor = GFColors.PRIMARY,
  this.submitButton,
  this.cancelButton,
  this.expandedIcon = const Icon(
    Icons.keyboard_arrow_down,
    color: Colors.black87,
    size: 30,
  ),
  this.collapsedIcon = const Icon(
    Icons.keyboard_arrow_up,
    color: Colors.black87,
    size: 30,
  ),
  this.focusNode,
  this.dropdownBgColor = Colors.white,
  this.activeIcon = const Icon(
    Icons.check,
    size: 20,
    color: GFColors.DARK,
  ),
  this.inactiveIcon,
  this.customBgColor = GFColors.SUCCESS,
  this.selected = false,
  this.dropdownTitleTileBorder,
  this.dropdownTitleTileBorderRadius =
      const BorderRadius.all(Radius.circular(4)),
  this.dropdownTitleTileColor = GFColors.WHITE,
  this.hideDropdownUnderline = false,
  this.dropdownUnderlineBorder =
      const BorderSide(color: Colors.black45, width: 1),
  this.dropdownTitleTileMargin = const EdgeInsets.all(16),
  this.dropdownTitleTilePadding = const EdgeInsets.all(12),
  this.dropdownTitleTileHintText,
  this.dropdownTitleTileHintTextStyle =
      const TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
  this.dropdownButton,
  Key? key,
}) : super(key: key);