widgetOnColor static method
Widget
widgetOnColor(
- BuildContext context, {
- required Widget widget,
- Color? backgroundColor,
- EdgeInsetsGeometry? padding,
Wraps a widget in a colored rounded container.
Parameters:
context: The build contextwidget: The widget to wrapbackgroundColor: Optional background color. Defaults to greypadding: Optional padding. Defaults to 10 on all sides
Implementation
static Widget widgetOnColor(BuildContext context, {required Widget widget, Color? backgroundColor, EdgeInsetsGeometry? padding})
{
return Container(
decoration: BoxDecoration(
color: backgroundColor ?? Colors.grey.shade200,
borderRadius: BorderRadius.circular(6)
),
padding: padding ?? EdgeInsets.all(10),
child: widget
);
}