Comments (2)
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.
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)
- Swap animation not working as expected HOT 3
- Autoplay property is not working properly HOT 1
- interval property no more avalaible in animate() since 4.3.0 HOT 2
- Add An Equivalent to `AnimatedSwitcher` HOT 7
- Combining 2 scaleXY is buggy HOT 1
- Can't get animation to run when calling set state HOT 2
- animate has no property controller on widget list HOT 1
- How do I restart an animation when a widget gets rebuilt?
- Animate custom property with minimal boilerplate (Similar to Implict Widgets) HOT 2
- feature request: clone "xyz extension" documentation to chaining methods HOT 3
- Animate widgets Bug on app release mode
- Allow onInit to prevent play
- max for repeat play only once HOT 1
- Having two Widgets with the same AnimationController can cause errors
- Add an `AnimationLimiter` kinda feature.
- Setting autoPlay to false but defining an onPlay callback tints the console yellow
- Kindly Add VISUAL (gif) images on the pub.dev page, for most common animations woth example
- [Question] Why is this behaviour happening?
- The `flip` effect
- How to use different animations delay on appear than on going away HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_animate.