Reputation: 3652
I'm following this guide for an animation: https://mightytechno.com/flutter-glow-pulse-animation/
When I go to use this
it won't let me pass it. I can't compile and flutter clean does nothing. What object can I pass to get rid of this error?
void initState() {
getSharedPrefs();
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 2));
_animationController.repeat(reverse: true);
_animation = Tween(begin: 2.0,end: 15.0).animate(_animationController)..addListener((){
setState(() {
});
});
Upvotes: 2
Views: 1644
Reputation: 156
You need to use the SingleTickerProviderStateMixin
to use this as vsync param. You can achieve this by using with keyword here is how:
class Social4state extends State<UserProfilePage> with SingleTickerProviderStateMixin
Upvotes: 0
Reputation: 3652
Extending SingleTickerProviderStateMixin
fixed the issue:
class Social4state extends State<UserProfilePage> with SingleTickerProviderStateMixin{
Upvotes: 6