GfMultiChipSelectData constructor

GfMultiChipSelectData({
  1. required List<String> values,
  2. TextStyle? lableStyle,
  3. Color? selectedColor,
  4. Color? unselectedColor,
  5. List<int>? preselected,
})

Implementation

GfMultiChipSelectData(
    {required this.values,
    this.lableStyle,
    this.selectedColor,
    this.unselectedColor,
    this.preselected}) {
  if (preselected != null) {
    for (int xb = 0; xb < values.length; xb++) {
      if (preselected!.contains(xb)) {
        chipsdata.add(ChipData(text: values[xb], selected: true));
      } else {
        chipsdata.add(ChipData(text: values[xb], selected: false));
      }
    }
  } else {
    chipsdata =
        values.map((e) => ChipData(text: e, selected: false)).toList();
  }
}