RadialAnimation constructor

RadialAnimation({
  1. Key? key,
  2. required AnimationController controller,
  3. required List<RadialButton> radialButtons,
  4. double centerSizeOfButton = 0.5,
})

Implementation

RadialAnimation(
    {Key? key,
    required this.controller,
    required this.radialButtons,
    this.centerSizeOfButton = 0.5})
    :
      // translation animation
      translation = Tween<double>(
        begin: 0.0,
        end: 100.0,
      ).animate(
        CurvedAnimation(parent: controller, curve: Curves.elasticOut),
      ),

      // scaling animation
      scale = Tween<double>(
        begin: centerSizeOfButton * 2,
        end: 0.0,
      ).animate(
        CurvedAnimation(parent: controller, curve: Curves.fastOutSlowIn),
      ),

      // rotation animation
      rotation = Tween<double>(
        begin: 0.0,
        end: 360.0,
      ).animate(
        CurvedAnimation(
          parent: controller,
          curve: Interval(
            0.0,
            0.7,
            curve: Curves.decelerate,
          ),
        ),
      ),
      super(key: key);