diff --git a/lib/src/components/chips/chip.dart b/lib/src/components/chips/chip.dart index e6a09f78..545edd73 100644 --- a/lib/src/components/chips/chip.dart +++ b/lib/src/components/chips/chip.dart @@ -95,9 +95,7 @@ class _ZetaChipState extends State { super.initState(); selected = widget.selected ?? false; _draggable = widget.draggable; - WidgetsBinding.instance.addPostFrameCallback((_) { - _updateControllerState(); - }); + _handleDisabledState(); } @override @@ -106,12 +104,10 @@ class _ZetaChipState extends State { if (oldWidget.selected != widget.selected) { selected = widget.selected ?? false; } - WidgetsBinding.instance.addPostFrameCallback((_) { - _updateControllerState(); - }); + _handleDisabledState(); } - void _updateControllerState() { + void _handleDisabledState() { if (widget.onTap == null && widget.onToggle == null) { _controller.update(WidgetState.disabled, true); setState(() {