Flutter-플러터/플러터 공부
Getx Getview를 활용한 애니메이션
일기월장
2023. 11. 17. 23:58
반응형
복붙임
class HomePageController extends GetxController
with GetSingleTickerProviderStateMixin {
final Duration duration = const Duration(milliseconds: 300);
AnimationController animationController;
@override
void onInit() {
super.onInit();
animationController = AnimationController(vsync: this, duration: duration);
}
}
class HomePage extends GetView
@override
Widget build(BuildContext context) {
// access animation controller on this page with controller.animationController
return Container();
}
}
Future initAnimationController() async {
animationController = AnimationController(vsync: this, duration: duration);
}
방법 2
class HomePage extends GetView with SingleGetTickerProviderMixin {
}
https://ithelp.ithome.com.tw/articles/10266087?sc=rss.iron
반응형