AnimationComponent constructor

AnimationComponent(
  1. String src, {
  2. String? state,
  3. String? prefix,
  4. AssetsCache? cache,
  5. CaseSensitivity stateNameSensitivity = CaseSensitivity.insensitive,
  6. 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;