Border class
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