Grid class
A widget that renders a static 2D grid of customized GridCells.
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([
[GridCell('█', Style(foreground: Color(0xFF00FF00))), GridCell(' ', Style.empty)],
[GridCell(' ', Style.empty), GridCell('█', Style(foreground: Color(0xFF00FF00)))],
]);
Properties and Settings
| Property | Type | Description |
|---|---|---|
tiles |
List<List<GridCell>> | 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.
override
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
getIntrinsicWidth(
int height) → int -
Computes the intrinsic width of this widget under the given
heightconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited