convert method

  1. @override
AreaStyle convert(
  1. double animatorPercent
)
override

该方法由子类复写且只能在getValue内部调用

Implementation

@override
AreaStyle convert(double animatorPercent) {
  BoxShadow? shadow = end.shadow;
  if (_boxShadowTween != null) {
    shadow = _boxShadowTween?.convert(animatorPercent);
  } else {
    if (begin.color != null && end.shadow != null) {
      shadow = BoxShadow(
        color: Color.lerp(begin.color!, end.shadow!.color, animatorPercent)!,
        offset: end.shadow!.offset,
        blurStyle: end.shadow!.blurStyle,
        spreadRadius: end.shadow!.spreadRadius,
        blurRadius: end.shadow!.blurRadius,
      );
    }
  }

  return AreaStyle(
    color: _colorTween?.convert(animatorPercent) ?? (begin.color ?? end.color),
    border: _lineStyleTween?.convert(animatorPercent) ?? (begin.border ?? end.border),
    shadow: shadow,
    shader: _chartShaderTween?.convert(animatorPercent) ?? (begin.shader ?? end.shader),
  );
}