Coder Social home page Coder Social logo

Comments (6)

umberto-sonnino avatar umberto-sonnino commented on July 20, 2024 2

Hey @ricsmania thanks so much for the PR, this is another great catch!

We reviewed it, and it happens quite often, in complex rigs, that people use empty nodes as targets. It would be beneficial to save the extra memory and check for the nullness of the item before calling the iterator:

if(children != null) {
  for (ActorNode in children) {
    [...]
  }
}

Feel free to update your PR with this, and we'll merge it!

from flare-flutter.

ricsmania avatar ricsmania commented on July 20, 2024

I created a PR with a suggested solution.

from flare-flutter.

luigi-rosso avatar luigi-rosso commented on July 20, 2024

Thanks for your continued contributions @ricsmania!

from flare-flutter.

ricsmania avatar ricsmania commented on July 20, 2024

@umberto-sonnino I updated the PR with your suggestion. I also saw another unchecked part here on actor_node.dart:

bool all(NodeWalkCallback cb) {
    if (cb(this) == false) {
      return false;
    }

    // here
    for (ActorNode child in _children) {
      if (cb(child) == false) {
        return false;
      }

      child.eachChildRecursive(cb);
    }

    return true;
  }

I didn't get any errors there, so I left it alone, but if you think that should also be checked I can add it too.

@luigi-rosso no problem, I'm happy to help!

from flare-flutter.

vidu171 avatar vidu171 commented on July 20, 2024

Hey, I came across this error while I was making an app, is there any solution that i can implement?, Like I tried to delete all the empty nodes from my flare file. But it did not do anything

from flare-flutter.

vidu171 avatar vidu171 commented on July 20, 2024

@ricsmania , thanks a lot your solution worked I would also like to point out that in the flare.dart file there is a similar problem and I made the following changes



if (children != null) {
      for (ActorNode node in children) {
        FlutterPath flutterPath = node as FlutterPath;
        if (flutterPath != null) {
          Mat2D transform = (node as ActorBasePath).pathTransform;
          _path.addPath(flutterPath.path, ui.Offset.zero,
              matrix4: transform == null ? null : transform.mat4);
        }
      }
    }

which is now working completely fine. I will make a PR for it soon.

from flare-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.