highlight method

NikuButton highlight(
  1. Color highlight
)

Apply highlight color

Equivalent to

TextButton(
  color: MaterialStateProperty.resolveWith<T>((states) {
    if (states.contains(MaterialState.focused)) return focused;
    if (states.contains(MaterialState.hovered)) return hovered;
    if (states.contains(MaterialState.pressed)) return pressed;
    if (states.contains(MaterialState.selected)) return selected;

    return null
  })
)

Implementation

NikuButton highlight(Color highlight) {
  this._backgroundColor.update(
      hovered: highlight,
      focused: highlight,
      pressed: highlight,
      selected: highlight);

  return this;
}