BorderSide
Creates the side of a border.
By default, the border is 1.0 logical pixels wide and solid black color.
Properties
-
color(ColorValue) –The color of this side of the border.
-
stroke_align(BorderSideStrokeAlignValue) –The relative position of the stroke on a
BorderSidein an -
stroke_inset–The amount of the stroke width that lies inside this
BorderSide. -
stroke_offset–The offset of the stroke, taking into account the stroke alignment.
-
stroke_outset–The amount of the stroke width that lies outside this
BorderSide. -
style(BorderStyle) –The style of this side of the border.
-
width(Number) –The width of this side of the border, in logical pixels.
Methods
-
copy–Returns a copy of this object with the specified properties overridden.
-
none–A hairline black border that is not rendered.
Properties#
stroke_align
#
stroke_align: BorderSideStrokeAlignValue = INSIDE
The relative position of the stroke on a BorderSide in an
OutlinedBorder or Border.
stroke_inset
#
The amount of the stroke width that lies inside this BorderSide.
For example, this will return the width for a stroke_align of -1, half
the width for a stroke_align of 0, and 0 for a stroke_align of 1.
stroke_offset
#
The offset of the stroke, taking into account the stroke alignment.
For example, this will return the negative width of the stroke
for a stroke_align of -1, 0 for a stroke_align of 0, and the
width for a stroke_align of -1.
stroke_outset
#
The amount of the stroke width that lies outside this BorderSide.
For example, this will return 0 for a stroke_align of -1, half the
width for a stroke_align of 0, and the width for a
stroke_align of 1.
style
#
style: BorderStyle = SOLID
The style of this side of the border.
Tip
To omit a side, set style to BorderStyle.NONE. This skips
painting the border, but the border still has a width.
width
#
width: Number = 1.0
The width of this side of the border, in logical pixels.
Setting width to 0.0 will result in a hairline border. This means that the border will have the width of one physical pixel. Hairline rendering takes shortcuts when the path overlaps a pixel more than once. This means that it will render faster than otherwise, but it might double-hit pixels, giving it a slightly darker/lighter result.
Tip
To omit the border entirely, set the style
to BorderStyle.NONE.
Raises:
-
ValueError–If it is less than zero.
Methods#
copy
#
copy(
*,
width: Number | None = None,
color: ColorValue | None = None,
stroke_align: BorderSideStrokeAlignValue | None = None,
) -> BorderSide
Returns a copy of this object with the specified properties overridden.