border method
void
border({
- double? all,
- double? left,
- double? right,
- double? top,
- double? bottom,
- Color color = const Color(0xFF000000),
- BorderStyle style = BorderStyle.solid,
inherited
Border for the widget
..border(all: 3.0, color: hex('#55ffff'), style: BorderStyle.solid)
Choose between all
, left
, right
, top
and bottom
. all
works together with the other properties.
Implementation
void border(
{double? all,
double? left,
double? right,
double? top,
double? bottom,
Color color = const Color(0xFF000000),
BorderStyle style = BorderStyle.solid}) {
_styleModel.border = Border(
left: (left ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: left ?? all!, style: style),
right: (right ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: right ?? all!, style: style),
top: (top ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: top ?? all!, style: style),
bottom: (bottom ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: bottom ?? all!, style: style),
);
}