tags: Flutter Physical animation
abstract class Simulation {
double x(double time);
double dx(double time);
bool isDone(double time);
}
Description:
| Class name | Description |
|---|---|
| BouncingScrollSimulation | Boundary rollover physical engine |
| BoundedFrictionSimulation | Boundary friction simulation engine |
| ClampedSimulation | Interval simulation engine |
| ClampingScrollSimulation | Interval scrolling simulation engine |
| FrictionSimulation | Friction simulation engine |
| GravitySimulation | Drop simulation engine |
| ScrollSpringSimulation | Spring rolling simulation |
| SpringSimulation | Spring simulation |

class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin //TickerProviderStateMixin
double value=0;
var clampSimulation=ClampingScrollSimulation(position: 200, velocity: 1);
Ticker tic;
@override
void initState() {
super.initState();
tic=createTicker((elapsed) {
if (!clampSimulation.isDone(elapsed.inMicroseconds/1000)) {
setState(() {
value=clampSimulation.x(elapsed.inMicroseconds/1000);
});
}
});
}
// animation settings
Center(
child: GestureDetector(
onTap: () {if (!tic.isActive) {tic.start();}},
child: Container(
height: 100,
width: 100,
color: Colors.red,
margin: EdgeInsets.only(left: value),
alignment: Alignment.center,
Child: Text ('Point I started animation',),
),
),
)

I. Overview Lottie is an ARIBNB open source for high-performance animation library for Android, iOS, etc. The flutter native bank does not support Lottie, but the animation effect of Lottie can be imp...
I. Overview NIMA is a 2D vector animation tool for Skia-rendering NIMA's use operation is basically the same as Flare NIMA file decompression is included.nma.bytesFile and.pngImage file, specified whe...
I. Overview Rive is a FLARE upgrade version, is a real-time interaction design and animation tool. The reciprion of the file is.riv, Use it when loading animation isRive Flutter runtime Rive supports ...
We know that AnimationController.forward () can play animation in forward direction, if you want to play animation in reverse, you can call AnimationController.reverse () Step on the pit Immediately w...
Introduction We know that AnimationController.forward () can play the animation in the forward direction, and AnimationController.reverse () can play the animation in the reverse direction. If you wan...
I. Overview Hero animation is also called transition animation Excessive animation: When the user clicks on a picture, switch to another page, this page also has this picture. Di Hero 2.1 Constructor ...
I. Overview List animation, AnimatedList animation, is a display list data when component animation When the data of the list changes (when adding or deleted), show this change in the form of animatio...
Source code analysis In the previous article we introduced that the addListener of Animation can be used to monitor the changes of each frame of the animation And if you want to monitor the status cha...
1. Which types of animation 2. Add animation 3. Add a monitor to animation 4.AnImatedWidget and AnimatedBuilder 5. Hero animation 1. Which types of animation About two categories: Tween -based and phy...
UIDynamicAnimator is a physical model introduced by iOS7 to simulate the real world. is equivalent to a physical coordinate system. Add physical behavior to this, relative to the force of this coordin...