Animation
IconButton( icon: AnimatedIcon( progress: _animationController, icon: AnimatedIcons.play_pause, ), onPressed: () { if (playStatus.isPlaying) { _animationController.reverse(); _stop(); } else { _animationController.forward(); _play(downloadLocation ?? item.guid); } } )
We need…
static final sinePeriod = 2 * pi; double _endValue = 0; if (episode.percentDownloaded == 1 && !episode.hasNotified){ _endValue = sinePeriod; episode.downloadNotified(); } TweenAnimationBuilder( tween: Tween<double>(begin:0, end:_endValue), duration: Duration(milliseconds: 200), child: child, builder: (_, double value, Widget child){ double offset = sin(value); return Transform.translate( offset: Offset(0, offset * 2), child: child, ); } )
AnimatedOpacity( child: child, opaticy: _getOpacity(value.percentDownloaded), duration: Duration(milliseconds: 100), ) double _getOpacity(double percentDownloaded) => percentDownloaded * (1- _defaultOpacity) + _defualt...
Is my animation more like a drawing
- Rive
“Pure Flutter Animatios”: Two kinds
Does my animation repeat forever?
Is is discontinuous?
Are multiple widgets animating together?
YES, use an Explicit animation
<uml>
if (Code-based animation questions) then (yes)
:Implicit animation;
else (
- Does it repeat 'forever'?
- Is it 'discontinuous'?
- Do multiple widgets animate together?
)
:Explicit animation;
</uml>
Built-in implicit animation
TweenAnimationBuilder
1. Flutter code or plugin?
2. Implicit or Explicit?
3. Built-in or custom?