1、例如,控制图片的透明度及缩放。
则需要使用AnimatedBuilder
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return (Material(
color: Colors.transparent,
child: Listener(
onPointerDown: (e) => widget.handlePointerDown(),
child: Opacity(
opacity: _animation1.value,
child: Transform.scale(
scale: _animation2.value,
child: Image.file(
File(widget.path),
// gaplessPlayback: true,
))))));
});