FTxShadow constructor
FTxShadow({})
Implementation
FTxShadow(
{double elevation = 8,
double? spreadRadius,
double? blurRadius,
Offset? offset,
FTxShadowPosition position = FTxShadowPosition.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 FTxShadowPosition.topLeft:
this.offset = Offset(-elevation, -elevation);
break;
case FTxShadowPosition.top:
this.offset = Offset(0, -elevation);
break;
case FTxShadowPosition.topRight:
this.offset = Offset(elevation, -elevation);
break;
case FTxShadowPosition.centerLeft:
this.offset = Offset(-elevation, elevation * 0.25);
break;
case FTxShadowPosition.center:
this.offset = Offset(0, 0);
break;
case FTxShadowPosition.centerRight:
this.offset = Offset(elevation, elevation * 0.25);
break;
case FTxShadowPosition.bottomLeft:
this.offset = Offset(-elevation, elevation);
break;
case FTxShadowPosition.bottom:
this.offset = Offset(0, elevation);
break;
case FTxShadowPosition.bottomRight:
this.offset = Offset(elevation, elevation);
break;
}
}
}