CustomChip constructor

const CustomChip({
  1. Key? key,
  2. required String label,
  3. VoidCallback? onDeleted,
  4. Color? backgroundColor,
  5. Color? labelColor,
  6. IconData? avatar,
})

Creates a CustomChip with the required label and optional parameters

If onDeleted is provided, a delete icon will be shown. The backgroundColor and labelColor can be used to override default colors. If avatar is provided, it will be displayed as an icon at the start of the chip.

Example with avatar:

CustomChip(
  label: 'JavaScript',
  avatar: Icons.code,
  backgroundColor: Colors.amber[100],
  labelColor: Colors.amber[900],
  onDeleted: () => removeLanguage('JavaScript'),
)

Implementation

const CustomChip({
  super.key,
  required this.label,
  this.onDeleted,
  this.backgroundColor,
  this.labelColor,
  this.avatar,
});