addChip method
adds the chip to the list, clear the text field and calls widget.onChanged
Implementation
void addChip(String value) {
if (value.isEmpty || _hasReachedMaxChips) return;
setState(() {
chips.add(value.trim());
});
textCtrl.clear();
widget.onChanged(chips.toList(growable: false));
}