getRtBoxWithElevation method

Widget getRtBoxWithElevation(
  1. Widget childWidget, {
  2. double margin = 8.0,
  3. double elevation = 4.0,
  4. double borderRadius = 4.0,
  5. Color color = Colors.white,
  6. double padding = 8.0,
})

Creates an elevated card container (alias method).

This is a variant of getBoxWithElevation with slightly different default parameters. Provides the same functionality with alternative naming for legacy compatibility.

Parameters:

  • childWidget: The widget to wrap in the card.
  • margin: Vertical margin around the card (defaults to 8.0).
  • elevation: Shadow depth (defaults to 4.0).
  • borderRadius: Corner radius (defaults to 4.0).
  • color: Background color (defaults to white).
  • padding: Internal padding (defaults to 8.0).

Returns a Card widget with the specified styling.

See also:

Implementation

Widget getRtBoxWithElevation(Widget childWidget,
    {double margin = 8.0,
    double elevation = 4.0,
    double borderRadius = 4.0,
    Color color = Colors.white,
    double padding = 8.0}) {
  return Card(
    elevation: elevation,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(borderRadius),
    ),
    margin: EdgeInsets.symmetric(vertical: margin),
    color: color,
    child: Padding(
      padding: EdgeInsets.all(padding),
      child: childWidget,
    ),
  );
}