border method
Widget
border(
- BuildContext context, {
- double radius = 5,
- EdgeInsetsGeometry padding = const EdgeInsets.all(5),
- Color? borderColor,
Wraps this widget in a Container with a border.
Parameters:
context: The build context to access theme dataradius: Border radius, defaults to 5padding: Padding inside the border, defaults to 5 on all sidesborderColor: Border color, defaults to theme's disabled color
Implementation
Widget border(BuildContext context,
{double radius = 5,
EdgeInsetsGeometry padding = const EdgeInsets.all(5),
Color? borderColor}) {
borderColor ??= Theme.of(context).disabledColor;
return Container(
padding: padding,
decoration: BoxDecoration(
border: Border.all(
color: borderColor,
),
borderRadius: BorderRadius.circular(radius)),
child: this);
}