smart_flare icon indicating copy to clipboard operation
smart_flare copied to clipboard

Problem with filename in CycleFlareActor

Open sharkpowah opened this issue 5 years ago • 2 comments

In "/lib/actors/cycle_flare_actor.dart" I had to change on Widget Build the filename, in fact every time I tried to use this actor, VSCode gave me problem as he didn't find any "button-animation.flr" asset in assets folder.

sharkpowah avatar Sep 26 '20 15:09 sharkpowah

Did you add your animation to pubspec.yaml?

FilledStacks avatar Sep 27 '20 14:09 FilledStacks

Yes, of course. Problem is here, I fixed it locally, it is a little fix, nothing to worry about.

I just changed the filename part in this portion of code in '/lib/actors/cycle_flare_actor.dart' from:

  Widget build(BuildContext context) {
    return SmartFlareActor(
      width: widget.width,
      height: widget.height,
      filename: 'assets/button-animation.flr',  <-------
      startingAnimation: widget.animations[animationIndex],
      activeAreas: [
        ActiveArea(
            area: Rect.fromLTWH(0, 0, widget.width, widget.height),
            animationsToCycle: widget.animations)
      ],
    );
  }

in this:

  Widget build(BuildContext context) {
    return SmartFlareActor(
      width: widget.width,
      height: widget.height,
      filename: widget.filename,  <-----
      startingAnimation: widget.animations[animationIndex],
      activeAreas: [
        ActiveArea(
            area: Rect.fromLTWH(0, 0, widget.width, widget.height),
            animationsToCycle: widget.animations)
      ],
    );
  }

sharkpowah avatar Sep 27 '20 15:09 sharkpowah