Skip to content

Commit

Permalink
fix: changed _updateControllerState to _handleDisabledState
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Nov 7, 2024
1 parent 4aea008 commit 8db89f4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/src/components/chips/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class _ZetaChipState extends State<ZetaChip> {
super.initState();
selected = widget.selected ?? false;
_draggable = widget.draggable;
WidgetsBinding.instance.addPostFrameCallback((_) {
_updateControllerState();
});
_handleDisabledState();
}

@override
Expand All @@ -106,12 +104,10 @@ class _ZetaChipState extends State<ZetaChip> {
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(() {
Expand Down

0 comments on commit 8db89f4

Please sign in to comment.