bordered method
Implementation
Widget bordered({
bool top = true,
bool bottom = true,
bool left = true,
bool right = true,
Color color = Colors.black12,
double radius = 4.0,
}) {
final border = BorderSide(color: color);
return Container(
decoration: BoxDecoration(
borderRadius: top && bottom && left && right ? BorderRadius.all(Radius.circular(radius)) : null,
border: Border(
top: top ? border : BorderSide.none,
bottom: bottom ? border : BorderSide.none,
left: left ? border : BorderSide.none,
right: right ? border : BorderSide.none,
),
),
child: this,
);
}