Grid class
A widget that renders a static 2D grid of customized Cells.
It acts like a tile map, copying characters and styles from the provided 2D array directly into the local draw buffer up to the active constraints.
Example Usage
final map = Grid([
[Cell('█', Style(foreground: Color(0xFF00FF00))), Cell(' ', Style.empty)],
[Cell(' ', Style.empty), Cell('█', Style(foreground: Color(0xFF00FF00)))],
]);
Properties and Settings
| Property | Type | Description |
|---|---|---|
tiles |
List<List<Cell>> | A 2D list of cells representing rows and columns. |
Properties
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
inherited
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
Buffer buffer, Rect area) → void -
Renders the widget onto the provided
bufferwithin the specifiedarea.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited