Viewport class

Undocumented public member.

Implemented types
Available extensions

Constructors

Viewport(Buffer parent, Rect bounds)
Creates a viewport wrapping parent constrained to bounds.

Properties

attributes Uint32List
Single unified data array for fg, bg, and modifiers. layout: fg, bg, mod, fg, bg, mod...
getter/setter pairoverride
bounds Rect
The rectangular bounds within the parent buffer.
final
characters List<String>
Flat list of characters representing the grid.
getter/setter pairoverride
effects List<RegisteredEffect>
The list of terminal effects registered in this buffer.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
height int
The height of the buffer in rows.
getter/setter pairoverride
parent Buffer
The underlying parent buffer.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
The width of the buffer in columns.
getter/setter pairoverride

Methods

addEffect(RegisteredEffect effect) → void
Adds a terminal effect to this buffer.
override
clear() → void
Resets all cells in the buffer to transparent empty cells.
override
fillAttributes({String? char, int? fg, int? bg, int? modifiers}) → void
Fills the entire buffer with the specified attributes.
override
fillBackgroundStyle(Rect bounds, Style style, BlendOption blend) → void

Available on Buffer, provided by the EffectHelpers extension

Fills the background style of all cells in bounds using blend.
fillForegroundStyle(Rect bounds, Style style, BlendOption blend) → void

Available on Buffer, provided by the EffectHelpers extension

Fills the foreground style of all cells in bounds using blend.
getBackground(int x, int y) int
Gets the background color at (x, y). Returns 0 if coordinates are out of bounds.
override
getCharacter(int x, int y) String
Gets the character at (x, y). Returns a space if coordinates are out of bounds.
override
getForeground(int x, int y) int
Gets the foreground color at (x, y). Returns 0 if coordinates are out of bounds.
override
getModifiers(int x, int y) int
Gets the modifiers at (x, y). Returns transparent if coordinates are out of bounds.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(int newWidth, int newHeight) → void
Resizes the buffer to the new dimensions, preserving existing content where it fits.
override
rotateColumn(Rect bounds, int colIndex, int amount) → void

Available on Buffer, provided by the EffectHelpers extension

Rotates a specific column within the given bounds by amount downward.
rotateRow(Rect bounds, int rowIndex, int amount) → void

Available on Buffer, provided by the EffectHelpers extension

Rotates a specific row within the given bounds by amount rightward.
setAttributes(int x, int y, {String? char, int? fg, int? bg, int? modifiers}) → void
Sets the cell attributes at (x, y). Does nothing if coordinates are out of bounds.
override
setBackground(int x, int y, int bg) → void
Sets background color at coordinates.
override
setCell(int x, int y, String char, int fg, int bg, int mod) → void
Sets character, colors, and modifiers at coordinates.
override
setCharacter(int x, int y, String char) → void
Sets character at coordinates.
override
setForeground(int x, int y, int fg) → void
Sets foreground color at coordinates.
override
setModifiers(int x, int y, int mod) → void
Sets modifiers at coordinates.
override
toString() String
A string representation of this object.
inherited
writeString(int x, int y, String text, Style style) → void
Writes styled text to the buffer starting at (x, y).
override

Operators

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