Box
Category: UI
Source: box.dart
Classes
Box
Immutable set of box-drawing characters for rectangular borders.
Inspired by Rich's Box class — pure data with rendering helpers. Separates character definitions (what to draw) from color (how to style).
Constructor
dart
const Box({
required this.topLeft,
required this.top,
required this.topRight,
required this.left,
required this.right,
required this.bottomLeft,
required this.bottom,
required this.bottomRight,
})Properties
| Property | Type | Description |
|---|---|---|
topRight | String topLeft, top, | |
right | String left, | |
bottomRight | String bottomLeft, bottom, | |
light | const | Light box-drawing: ┌─┐│└┘ |
heavy | const | Heavy/double box-drawing: ╔═╗║╚╝ |
rounded | const | Rounded box-drawing: ╭─╮│╰╯ |
Methods
`List<String> renderFrame(
int width,
int height,
String title, {
String color = '\x1b[2m',
})`
Render a complete border frame: top line with title, empty interior rows, and bottom line. Returns [height] lines, each [width] visible columns.
[color] is the ANSI escape for the border characters (e.g. '\x1b[2m' for dim, '\x1b[33m' for yellow). Title is always yellow.