updateState method
void
updateState(
)
override
Implementation
@mustCallSuper
@protected
@override
void updateState() {
if (isDisabled) {
setState(
_isSelected ? ButtonState.disabledAndSelected : ButtonState.disabled,
);
return;
}
if (isPressed) {
setState(
_isSelected ? ButtonState.downAndSelected : ButtonState.down,
);
return;
}
if (isHovered) {
setState(
_isSelected ? ButtonState.hoverAndSelected : ButtonState.hover,
);
return;
}
setState(
_isSelected ? ButtonState.upAndSelected : ButtonState.up,
);
}