setSkin method

  1. @override
  2. @protected
void setSkin(
  1. ButtonState state
)
override

Implementation

@override
@protected
void setSkin(ButtonState state) {
  var skin = skinsMap[state];
  if (state.isDisabledAndSelected && !hasSkinForState(state)) {
    skin = skinsMap[ButtonState.disabled];
  }
  if (state.isDownAndSelected && !hasSkinForState(state)) {
    skin = skinsMap[ButtonState.down];
  }
  if (state.isHoverAndSelected && !hasSkinForState(state)) {
    skin = skinsMap[ButtonState.hover];
  }
  if (state.isDownAndSelected && !hasSkinForState(state)) {
    skin = skinsMap[ButtonState.down];
  }
  skin = skin ?? (isSelected ? defaultSelectedSkin : defaultSkin);
  skin?.parent = skinContainer;
}