onPressed property

VoidCallback? onPressed

Called when the user taps the chip.

If onPressed is set, then this callback will be called when the user taps on the label or avatar parts of the chip. If onPressed is null, then the chip will be disabled.

class Blacksmith extends StatelessWidget {
  const Blacksmith({super.key});

  void startHammering() {
    print('bang bang bang');

  Widget build(BuildContext context) {
    return InputChip(
      label: const Text('Apply Hammer'),
      onPressed: startHammering,


VoidCallback? get onPressed;