Cell class final

A single cell in a terminal Buffer.

A cell contains one grapheme, a UvStyle, an optional Link, and its display width. This Dart port keeps the public mutable API but also caches a packed metadata signature so equality and hashing stay fast for the common case of plain single-rune cells.

Constructors

Cell({String content = '', UvStyle style = const UvStyle(), Link link = const Link(), Object? drawable, int? width})

Properties

asciiCodeUnit int?
Returns the printable ASCII code unit for this cell, if it has one.
no setter
content String
The grapheme content stored in this cell.
getter/setter pair
contentFingerprint int
A compact identity for just the cell content, excluding width/style/link.
no setter
drawable Object?
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Whether this cell represents a plain space with no attributes.
no setter
isZero bool
Whether this cell has no content, style, link, or drawable.
no setter
The canonicalized hyperlink metadata for this cell.
getter/setter pair
linkId int?
The pooled link id for this cell, if any.
no setter
packed PackedCell
Returns a fixed-layout packed cell tuple for fast comparisons.
no setter
pooledContentId int?
The pooled complex grapheme id for this cell, if any.
no setter
renderFingerprint int
A compact identity for full rendered output at one cell slot.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style UvStyle
The canonicalized style for this cell.
getter/setter pair
width int
The display width of this cell in terminal columns.
getter/setter pair

Methods

clone() Cell
Returns a copy of this cell.
cloneEmpty() Cell
Returns a blank space cell with the same style/link/drawable metadata.
copyEmptyFrom(Cell other) → void
Copies just the style/link/drawable payload from other and clears the content to a plain space cell.
copyFrom(Cell other) → void
Copies the full cell payload from other into this instance.
dispose() → void
Releases any pooled grapheme content owned by this cell.
empty() → void
Sets this cell to a space with width 1.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetToEmptyCell() → void
Resets this cell to a canonical empty space cell.
resetToZeroCell() → void
Resets this cell to a canonical zero-width placeholder cell.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

ascii(int codeUnit) Cell
Creates a one-cell printable ASCII cell without width/grapheme scanning.
asciiStyled(int codeUnit, {UvStyle style = const UvStyle(), Link link = const Link()}) Cell
Creates a styled one-cell printable ASCII cell without setter churn.
emptyCell() Cell
Creates a space cell with width 1.
newCell(WidthMethod method, String grapheme) Cell
Creates a new cell from a grapheme, computing its display width.
zeroCell() Cell
Creates an empty placeholder cell with zero width and no attributes.