delegate static method

WidgetBuilder delegate({
  1. Color? color,
  2. BoxBorder? border,
  3. BorderRadiusGeometry? borderRadius,
  4. EdgeInsetsGeometry? margin,
})

Creates a default overlay box with optional border and background color.

Props:

  • color: Background color inside the overlay bounds.
  • border: Custom border (e.g. Border.all(...)).
  • borderRadius: Rounded corners for the overlay box.
  • margin: Horizontal insets around the overlay box.

Implementation

static WidgetBuilder delegate({
  Color? color,
  BoxBorder? border,
  BorderRadiusGeometry? borderRadius,
  EdgeInsetsGeometry? margin,
}) {
  return (context) {
    return Container(
      margin: margin,
      decoration: BoxDecoration(
        border: border,
        borderRadius: borderRadius,
        color: color,
      ),
    );
  };
}