import 'package:flutter/animation.dart'; import 'package:get/get.dart'; class ShowPositionController extends GetxController with GetSingleTickerProviderStateMixin{ AnimationController? controller; Animation? animation; final alpha = 0.obs; ShowPositionController(){ controller = AnimationController( duration: const Duration(milliseconds: 5000), vsync: this); final sequence = TweenSequence([ TweenSequenceItem(tween: ConstantTween(255), weight: 3), TweenSequenceItem(tween: Tween(begin: 255, end: 0), weight: 2) ]); animation = sequence.animate(controller!) ..addListener(() { alpha.value = animation!.value.toInt(); }); } show(){ controller?.reset(); controller?.forward(); } }