cardViewPhysical static method

Widget cardViewPhysical({
  1. required Widget child,
  2. required double elevation_radius_value,
  3. double? radiusSize,
  4. Color? colorBackground,
  5. BorderRadius? radiusBorder,
})

Implementation

static Widget cardViewPhysical( {
  required Widget child,
  required double elevation_radius_value,  //
  double? radiusSize  ,
  Color? colorBackground,
  BorderRadius? radiusBorder, //see "BorderRadiusTools"

}) {

  //set default
  radiusSize ??= DSDimen.ds_size_corner_level_2;
  colorBackground ??= DSColor.cardview_background_color;

  //elevation
  var physical =   PhysicalModel(
    elevation: elevation_radius_value,
    color:  colorBackground,
    child: child,
  );

  //set default
  var objRadius = Radius.circular( radiusSize );
  var radiusCustom = BorderRadius.all(  objRadius );

  //set custom
  if( radiusBorder != null ) {
    radiusCustom = radiusBorder;
  }

  //clip to card shape
  return ClipRRect(
    borderRadius: radiusCustom,
    child: physical,
  );
}