asciiStyled static method

Cell asciiStyled(
  1. int codeUnit, {
  2. UvStyle style = const UvStyle(),
  3. Link link = const Link(),
})

Creates a styled one-cell printable ASCII cell without setter churn.

Implementation

static Cell asciiStyled(
  int codeUnit, {
  UvStyle style = const UvStyle(),
  Link link = const Link(),
}) {
  assert(codeUnit >= 0x20 && codeUnit < 0x7F);
  final styleId = _styleIdFor(style);
  final linkId = link.isZero ? 0 : _linkRegistry.intern(link);
  return Cell._packed(
    style: style,
    link: link,
    width: 1,
    contentKind: codeUnit == 0x20
        ? _CellContentKind.space
        : _CellContentKind.singleScalar,
    contentValue: codeUnit == 0x20 ? 0 : codeUnit,
    styleId: styleId,
    linkId: linkId,
  );
}