cardViewBlur static method

BoxDecoration cardViewBlur({
  1. required Color colorBackground,
  2. required Color colorBlur,
  3. required double radiusBoarderSize,
  4. required double radiusBlur,
  5. BorderRadius? radiusBorder,
  6. double widthShadow = 5,
  7. BlurStyle blurStyle = BlurStyle.normal,
  8. bool makeBlurColorDark = false,
})

Implementation

static BoxDecoration cardViewBlur( {
  required Color colorBackground,
  required Color colorBlur,
  required double radiusBoarderSize ,
  required double radiusBlur,
  BorderRadius? radiusBorder,
  double widthShadow = 5 ,
  BlurStyle blurStyle = BlurStyle.normal,
  bool makeBlurColorDark = false
}) {


  //radius
  radiusBoarderSize ??= DSDimen.ds_size_corner_level_2;
  var objRadius = Radius.circular( radiusBoarderSize );
  var radiusDefault = BorderRadius.all(  objRadius );
  radiusBorder ??= radiusDefault;


  List<BoxShadow> listShadow = [];
  //shadow >> left bottom
  var leftBottomShadow = BoxShadow(
      color: colorBlur,
      blurRadius: radiusBlur,
      offset: Offset(widthShadow,widthShadow),
      blurStyle: blurStyle,
      spreadRadius: 0
  );

  listShadow.add(leftBottomShadow);
  if( makeBlurColorDark) {
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
    listShadow.add(leftBottomShadow);
  }

  //box
  var box = BoxDecoration(
      boxShadow:  listShadow,
      borderRadius: radiusBorder ,
      color: colorBackground
  );
  return box;
}