Animations not playing after Navigator.pop
obrens opened this issue · comments
On ScreenA
I have some animations. When I pop out of ScreenB
, back into ScreenA
, the animations don't replay in spite of the screen rebuilding.
- I open
ScreenA
and the animations play. - I click a button on
ScreenA
to go toSrceenB
:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB()))
.then((value) {setState((){});});
- On
ScreenB
I click a button to return toScreenA
:
Navigator.pop(context)
setState
gets called as expected andScreenA
is rebuilt, but the animations don't replay.
I'm testing on Android.
Note that this is how Flutter animations generally behave. The controller has to be manually restarted after Navigator.pop. My issue is that I don't have a way of restarting animations built using this package.
Is there any way of getting it to work the way I want it to work?
On
ScreenA
I have some animations. When I pop out ofScreenB
, back intoScreenA
, the animations don't replay in spite of the screen rebuilding.
- I open
ScreenA
and the animations play.- I click a button on
ScreenA
to go toSrceenB
:Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB())) .then((value) {setState((){});});
- On
ScreenB
I click a button to return toScreenA
:
Navigator.pop(context)
setState
gets called as expected andScreenA
is rebuilt, but the animations don't replay.I'm testing on Android.
Note that this is how Flutter animations generally behave. The controller has to be manually restarted after Navigator.pop. My issue is that I don't have a way of restarting animations built using this package.Is there any way of getting it to work the way I want it to work?
I have that same issue. Did you find any solution?
Same issue
On
ScreenA
I have some animations. When I pop out ofScreenB
, back intoScreenA
, the animations don't replay in spite of the screen rebuilding.
- I open
ScreenA
and the animations play.- I click a button on
ScreenA
to go toSrceenB
:Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB())) .then((value) {setState((){});});
- On
ScreenB
I click a button to return toScreenA
:
Navigator.pop(context)
setState
gets called as expected andScreenA
is rebuilt, but the animations don't replay.I'm testing on Android.
Note that this is how Flutter animations generally behave. The controller has to be manually restarted after Navigator.pop. My issue is that I don't have a way of restarting animations built using this package.
Is there any way of getting it to work the way I want it to work?I have that same issue. Did you find any solution?
maby you can add a key to AnimationLimiter
like
AnimationLimiter(
key: ValueKey(data.length), //here
child: ListView()
)
it means that when your list size changed, the widget will rebuild
Same issue
look at my comment blow, hope I can help you
On
ScreenA
I have some animations. When I pop out ofScreenB
, back intoScreenA
, the animations don't replay in spite of the screen rebuilding.
- I open
ScreenA
and the animations play.- I click a button on
ScreenA
to go toSrceenB
:Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB())) .then((value) {setState((){});});
- On
ScreenB
I click a button to return toScreenA
:
Navigator.pop(context)
setState
gets called as expected andScreenA
is rebuilt, but the animations don't replay.I'm testing on Android.
Note that this is how Flutter animations generally behave. The controller has to be manually restarted after Navigator.pop. My issue is that I don't have a way of restarting animations built using this package.
Is there any way of getting it to work the way I want it to work?I have that same issue. Did you find any solution?
maby you can add a key to AnimationLimiter
likeAnimationLimiter( key: ValueKey(data.length), //here child: ListView() )
it means that when your list size changed, the widget will rebuild
What about when the list size is the same?