FxShadow.none constructor

FxShadow.none({
  1. double elevation = 0,
  2. double? spreadRadius,
  3. double? blurRadius,
  4. Offset? offset,
  5. FxShadowPosition position = FxShadowPosition.bottom,
  6. int? alpha,
  7. Color? color,
  8. bool darkShadow = false,
})

Implementation

FxShadow.none(
    {double elevation = 0, double? spreadRadius, double? blurRadius, Offset? offset, FxShadowPosition position = FxShadowPosition
        .bottom, int? alpha, Color? color, bool darkShadow = false}){
  this.spreadRadius = spreadRadius ?? elevation * 0.125;
  this.blurRadius = blurRadius ?? elevation * 2;
  this.alpha = alpha != null ? alpha : (darkShadow ? 100 : 36);
  this.elevation = elevation;
  this.offset = offset;
  this.position = position;
  this.color = color;
  this.darkShadow = darkShadow;

  if (offset == null) {
    switch (position) {
      case FxShadowPosition.topLeft:
        this.offset = Offset(-elevation, -elevation);
        break;
      case FxShadowPosition.top:
        this.offset = Offset(0, -elevation);
        break;
      case FxShadowPosition.topRight:
        this.offset = Offset(elevation, -elevation);
        break;
    //TO-DO: Shadow problem
      case FxShadowPosition.centerLeft:
        this.offset = Offset(-elevation, elevation * 0.25);
        break;
      case FxShadowPosition.center:
        this.offset = Offset(0, 0);
        break;
    //TO-DO: Shadow problem
      case FxShadowPosition.centerRight:
        this.offset = Offset(elevation, elevation * 0.25);
        break;
      case FxShadowPosition.bottomLeft:
        this.offset = Offset(-elevation, elevation);
        break;
      case FxShadowPosition.bottom:
        this.offset = Offset(0, elevation);
        break;
      case FxShadowPosition.bottomRight:
        this.offset = Offset(elevation, elevation);
        break;
    }
  }
}