Border class final
Represents the character set and style configuration used to draw a box border.
It supports various configurations including:
- Border.single: Standard single-line Unicode box characters (
┌,┐,└,┘,─,│). - Border.doubleLine: Double-line Unicode box characters (
╔,╗,╚,╝,═,║). - Border.rounded: Unicode box characters with rounded corners (
╭,╮,╰,╯,─,│). - Border.ascii: Portability-first plain ASCII characters (
+,-,|). - Border.none: Blank border lines.
Example Usage
const border = Border(
style: Style(foreground: Color(0xFF00FF00)), // Green borders
topChar: '─',
bottomChar: '─',
leftChar: '│',
rightChar: '│',
);
Configuration Properties
| Property | Type | Description |
|---|---|---|
style |
Style | Style attributes applied to the border cells. |
topChar |
String | Character used for the top horizontal border. |
bottomChar |
String | Character used for the bottom horizontal border. |
leftChar |
String | Character used for the left vertical border. |
rightChar |
String | Character used for the right vertical border. |
topLeftChar |
String | Character used for the top-left corner. |
topRightChar |
String | Character used for the top-right corner. |
bottomLeftChar |
String | Character used for the bottom-left corner. |
bottomRightChar |
String | Character used for the bottom-right corner. |
Constructors
- Border({Style style = Style.empty, String topChar = '─', String bottomChar = '─', String leftChar = '│', String rightChar = '│', String topLeftChar = '┌', String topRightChar = '┐', String bottomLeftChar = '└', String bottomRightChar = '┘'})
-
Creates a new Border configuration.
const
- Border.all([Style style = Style.empty])
-
Creates a single-line border with the specified
styleon all sides.const
Properties
- bottomChar → String
-
Character used for the bottom horizontal border.
final
- bottomLeftChar → String
-
Character used for the bottom-left corner.
final
- bottomRightChar → String
-
Character used for the bottom-right corner.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- leftChar → String
-
Character used for the left vertical border.
final
- rightChar → String
-
Character used for the right vertical border.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → Style
-
Style attributes applied to the border cells.
final
- topChar → String
-
Character used for the top horizontal border.
final
- topLeftChar → String
-
Character used for the top-left corner.
final
- topRightChar → String
-
Character used for the top-right corner.
final
Methods
-
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
Constants
- ascii → const Border
- Pure ASCII border for high portability.
- block → const Border
- Solid retro block border.
- braille → const Border
- Border using Braille patterns for a high-density, dot-matrix outline.
- dashed → const Border
- Light dashed border.
- diagonalBackslash → const Border
- Diagonal backslash border (top-left to bottom-right).
- diagonalSlash → const Border
- Diagonal slash border (top-right to bottom-left).
- doubleLine → const Border
- Double-line border.
- halfBlock → const Border
- Space-saving half-block border.
- heavy → const Border
- Heavy-line border.
- none → const Border
- No borders.
- quadDiagonals → const Border
- Border using quadrant diagonals for the corners.
- quadPadding → const Border
- Border using single quadrants for corners, creating an inner padding look.
- rounded → const Border
- Muted rounded corners border.
- shadedDark → const Border
- Dark shaded block border.
- shadedLight → const Border
- Light shaded block border.
- shadedMedium → const Border
- Medium shaded block border.
- single → const Border
- Standard single-line border.