ChipWidget<T> constructor
const
ChipWidget<T> ({
- Key? key,
- required List<
T> values, - required void onSelected(
- T value,
- int index
- String labelBuilder(
- T value
- WrapAlignment alignment = WrapAlignment.start,
- bool isEnabledRadioBtn = true,
- int initialIndex = 0,
- IconData selectedRadioIcon = Icons.check_circle,
- IconData? unselectedRadioIcon = Icons.radio_button_off,
- Color? selectedRadioIconColor,
- Color? unselectedRadioIconColor = Colors.black26,
- double radioIconSize = 18,
- Color? selectedColor,
- Color? unselectedColor,
- TextStyle? selectedTextStyle,
- TextStyle? unselectedTextStyle,
- double borderRadius = 20,
- Color borderColor = Colors.transparent,
- double borderWidth = 0,
- double chipHeight = 40,
- double? chipWidth,
- Duration animationDuration = const Duration(milliseconds: 250),
- Curve animationCurve = Curves.easeOut,
- bool enableTapEffect = true,
- double tapScale = 0.94,
- 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);