ChipWidget<T> constructor

const ChipWidget<T>({
  1. Key? key,
  2. required List<T> values,
  3. required void onSelected(
    1. T value,
    2. int index
    ),
  4. String labelBuilder(
    1. T value
    )?,
  5. WrapAlignment alignment = WrapAlignment.start,
  6. bool isEnabledRadioBtn = true,
  7. int initialIndex = 0,
  8. IconData selectedRadioIcon = Icons.check_circle,
  9. IconData? unselectedRadioIcon = Icons.radio_button_off,
  10. Color? selectedRadioIconColor,
  11. Color? unselectedRadioIconColor = Colors.black26,
  12. double radioIconSize = 18,
  13. Color? selectedColor,
  14. Color? unselectedColor,
  15. TextStyle? selectedTextStyle,
  16. TextStyle? unselectedTextStyle,
  17. double borderRadius = 20,
  18. Color borderColor = Colors.transparent,
  19. double borderWidth = 0,
  20. double chipHeight = 40,
  21. double? chipWidth,
  22. Duration animationDuration = const Duration(milliseconds: 250),
  23. Curve animationCurve = Curves.easeOut,
  24. bool enableTapEffect = true,
  25. double tapScale = 0.94,
  26. Duration tapDuration = const Duration(milliseconds: 120),
})

Implementation

const ChipWidget({
  Key? key,
  required this.values,
  required this.onSelected,
  this.labelBuilder,

  // Alignment
  this.alignment = WrapAlignment.start, // overall chips alignment

  // Radio icon
  this.isEnabledRadioBtn = true,
  this.initialIndex = 0,
  this.selectedRadioIcon = Icons.check_circle,
  this.unselectedRadioIcon = Icons.radio_button_off,
  this.selectedRadioIconColor,
  this.unselectedRadioIconColor = Colors.black26,
  this.radioIconSize = 18,

  // Colors
  this.selectedColor,
  this.unselectedColor,

  // Text styles
  this.selectedTextStyle,
  this.unselectedTextStyle,

  // UI
  this.borderRadius = 20,
  this.borderColor = Colors.transparent,
  this.borderWidth = 0,
  this.chipHeight = 40,
  this.chipWidth,

  // Selection animation
  this.animationDuration = const Duration(milliseconds: 250),
  this.animationCurve = Curves.easeOut,

  // Tap animation
  this.enableTapEffect = true,
  this.tapScale = 0.94,
  this.tapDuration = const Duration(milliseconds: 120),
}) : super(key: key);