withUnderlineStyle static method

int withUnderlineStyle(
  1. int mask,
  2. UnderlineStyle style
)

Encodes style into mask, setting or clearing underline accordingly.

Implementation

static int withUnderlineStyle(int mask, UnderlineStyle style) {
  if (style == UnderlineStyle.none) {
    return mask & ~(underline | underlineStyleMask);
  }
  return (mask & ~underlineStyleMask) | underline | style.bitMask;
}