determineControlState method

OudsButtonControlState determineControlState()

Method that determines the current state of the button based on its properties. Returns a value from the OudsButtonControlState enum.

Implementation

OudsButtonControlState determineControlState() {
  if (!enabled) return OudsButtonControlState.disabled;
  if (isPressed) return OudsButtonControlState.pressed;
  if (isHovered) return OudsButtonControlState.hovered;
  if (isLoading) return OudsButtonControlState.loading;
  return OudsButtonControlState.enabled;
}