foregroundColor method

NikuButton foregroundColor({
  1. Color? base,
  2. Color? disabled,
  3. Color? dragged,
  4. Color? error,
  5. Color? focused,
  6. Color? hovered,
  7. Color? pressed,
  8. Color? selected,
})

Apply color to foreground (ie. Text color)

Equivalent to

TextButton(
  foregroundColor: MaterialStateProperty.resolveWith<T>((states) {
    if (states.contains(MaterialState.disabled)) return disabled;
    if (states.contains(MaterialState.dragged)) return dragged;
    if (states.contains(MaterialState.error)) return error;
    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 base;
  });
)

Implementation

NikuButton foregroundColor({
  Color? base,
  Color? disabled,
  Color? dragged,
  Color? error,
  Color? focused,
  Color? hovered,
  Color? pressed,
  Color? selected,
}) {
  this._foregroundColor.update(
        base: base,
        disabled: disabled,
        dragged: dragged,
        error: error,
        focused: focused,
        hovered: hovered,
        pressed: pressed,
        selected: selected,
      );

  return this;
}