Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animations not playing after Navigator.pop #19

Open
obrens opened this issue Jun 19, 2020 · 6 comments
Open

Animations not playing after Navigator.pop #19

obrens opened this issue Jun 19, 2020 · 6 comments

Comments

@obrens
Copy link

obrens commented Jun 19, 2020

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.

  1. I open ScreenA and the animations play.
  2. I click a button on ScreenA to go to SrceenB:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB()))
.then((value) {setState((){});});
  1. On ScreenB I click a button to return to ScreenA:
    Navigator.pop(context)
  2. setState gets called as expected and ScreenA 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?

@hkndzdr
Copy link

hkndzdr commented Oct 30, 2020

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.

  1. I open ScreenA and the animations play.
  2. I click a button on ScreenA to go to SrceenB:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB()))
.then((value) {setState((){});});
  1. On ScreenB I click a button to return to ScreenA:
    Navigator.pop(context)
  2. setState gets called as expected and ScreenA 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?

@RaulMarquezInclan
Copy link

Same issue

@Jayshanx
Copy link

Jayshanx commented Aug 9, 2021

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.

  1. I open ScreenA and the animations play.
  2. I click a button on ScreenA to go to SrceenB:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB()))
.then((value) {setState((){});});
  1. On ScreenB I click a button to return to ScreenA:
    Navigator.pop(context)
  2. setState gets called as expected and ScreenA 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

@Jayshanx
Copy link

Jayshanx commented Aug 9, 2021

Same issue

look at my comment blow, hope I can help you

@boletoms
Copy link

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.

  1. I open ScreenA and the animations play.
  2. I click a button on ScreenA to go to SrceenB:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenB()))
.then((value) {setState((){});});
  1. On ScreenB I click a button to return to ScreenA:
    Navigator.pop(context)
  2. setState gets called as expected and ScreenA 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

What about when the list size is the same?

@taozhenglin
Copy link

it doesn't work at all on Android for Listview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants