border method
Implementation
Widget border({
Key? key,
double? all,
double? left,
double? right,
double? top,
double? bottom,
Color color = const Color(0xFF000000),
BorderStyle style = BorderStyle.solid,
bool animate = false,
}) {
BoxDecoration decoration = BoxDecoration(
border: Border(
left: (left ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: left ?? all ?? 0, style: style),
right: (right ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: right ?? all ?? 0, style: style),
top: (top ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: top ?? all ?? 0, style: style),
bottom: (bottom ?? all) == null
? BorderSide.none
: BorderSide(color: color, width: bottom ?? all ?? 0, style: style),
),
);
return animate
? _StyledAnimatedBuilder(
key: key,
builder: (animation) {
return _AnimatedDecorationBox(
child: this,
decoration: decoration,
duration: animation.duration,
curve: animation.curve,
);
},
)
: DecoratedBox(
key: key,
child: this,
decoration: decoration,
);
}