Giter Club home page Giter Club logo

Comments (2)

gskinner avatar gskinner commented on July 22, 2024

Hi @definev - glad you're liking the library! Currently to restart the animation, you can use its controller, which you can get from either onInit or onComplete:

foo.animate(
  onInit: (controller) => _animController = controller // save off the controller
).fade().slide() // or whatever.

// then later, restart the animation:
_animController.forward(0)

I believe (untested) you should also be able to restart the animation a bit more declaratively by assigning a new unique key to the animation when the view rebuilds.

foo.animate(
  key: myKey // change the key when you want it to restart.
).fade().slide()

In the future, I'd like to add a bit more state-awareness onto Animate so that this is a bit easier to control.

from flutter_animate.

definev avatar definev commented on July 22, 2024

Thank you, I like the key approach, it works but I am using AnimatedContainer in the child of Animate widget. Unfortunately, the side effect destroys the state of AnimatedContainer :( But I think I don't need AnimatedContainer, I can also calculate the size of the grid yourself, thank you for your answer! Love your package!

from flutter_animate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.