AnilocationTaskImpl constructor

AnilocationTaskImpl({
  1. required AnilocationTaskDescription description,
})

Implementation

AnilocationTaskImpl({required this.description})
    : super(description: description) {
  wrapper = animationWrapper();

  /*wrapper.locationTween = LocationTween(
    interpolator: LineLocationInterpolatorImpl(
      begin: description.begin.copyWith(markerId: description.markerId),
      end: description.end.copyWith(markerId: description.markerId),
    ),
  );*/

  _isActiveTrip = description.isActiveTrip;
  _useRotation = description.useRotation;

  //Bearing
  _bearingTween = BearingTween.from(wrapper.locationTween);

  _bearingAnimation = _bearingTween.curvedAnimate(
      controller: wrapper.locationCtrller, curve: description.curve);

  wrapper.locationCtrller.addListener(_locationListener);
  wrapper.locationCtrller.addStatusListener(_statusListener);

  _locationAnimation = wrapper.locationTween.curvedAnimate(
    controller: wrapper.locationCtrller,
    curve: description.curve,
  );

  _proxyAnim = ProxyAnimationGeneric<ILatLng>(_locationAnimation);

  //Ripple
  _rippleCtrller = AnimationController(
      vsync: description.vsync, duration: description.rippleDuration)
    ..addStatusListener(_rippleStatusListener)
    ..addListener(_rippleListener);

  _radiusTween = Tween<double>(begin: 0, end: description.rippleRadius);

  _radiusAnimation = _radiusTween.curvedAnimate(
      curve: Curves.linear, controller: _rippleCtrller);

  _colorAnimation = ColorTween(
    begin: description.rippleColor.withOpacity(1.0),
    end: description.rippleColor.withOpacity(0.0),
  ).curvedAnimate(curve: Curves.ease, controller: _rippleCtrller);
}