AnimationComponent constructor
- String src, {
- String? state,
- String? prefix,
- AssetsCache? cache,
- CaseSensitivity stateNameSensitivity = CaseSensitivity.insensitive,
- Mode mode = Mode.forward,
For frame-perfect animations, use AnimationComponent.framebased.
The underlining document structure of Boomsheets uses integer frames
and hertz (frames per second) to determine the time that each frame
needs in order to advance. Components using this constructor rely on
elapsed Duration delta-time (dt) in update which may exhibit
occasional frame-skips due to floating point precision drift.
src is the path of the document without prefix.
state is the inital Anim state to set if provided.
If state is null, there is no animation data to play from.
cache uses Flame.assets by default or a different one if provided.
stateNameSensitivity is used when fetching Anim states by their name.
mode dictates how an animation plays. Default is Mode.forward.
Implementation
AnimationComponent(
this.src, {
String? state,
String? prefix,
AssetsCache? cache,
this.stateNameSensitivity = CaseSensitivity.insensitive,
this.mode = Mode.forward,
}) : framebased = false,
_cache = cache,
_defaultState = state;