rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.2k stars 188 forks source link

Allow component to be found based on a predicate #395

Closed anurag-aofl closed 3 months ago

anurag-aofl commented 3 months ago

Currently, there's no easy way to find a Component (or sub-type) from an Artboard that matches a predicate (e.g. component whose name starts with "shoulder:"). We may be able to use the existing forEachComponent function and find a component that matches a predicate externally, but that has no way to return early once it finds a matching component.

This addition exposes a new API that allows users to find components that match a predicate more efficiently.

Thank you.

HayesGordon commented 3 months ago

This commit has been co-authored into our mono repository and is now available in rive: ^0.13.7.

Thanks for the contribution @anurag-aofl!

HayesGordon commented 3 months ago

https://github.com/rive-app/rive-flutter/commit/bf94e7d6b1176db2f8e12968322e67578ff97238

anurag-aofl commented 3 months ago

I appreciate the review and publish, @HayesGordon .