I develop an application in Flutter with a lot of animations quite varied. I would like to structure my code by separating views, logic (model BLoC) and ANIMATIONS. For this problem I try to declare several times the same animation for buttons in a different class of my StatefulWidget.
However, I am stuck because I have to pass a TickerProvider to my animation class, and I do not do it the right way.
Constructor animation class
AppBloc(TickerProvider tickerProvider) {
banimationController = AnimationController(
vsync: tickerProvider,
duration: Duration(milliseconds: 100),
lowerBound: 0,
upperBound: 0.05,
);
}
Declaration
AppBloc(this);
I know this is probably not the right way, I wrote this code to illustrate my problem.
I just want to separate my animations declarations in an other file.