user2216697
user2216697

Reputation: 303

Clear Stream subscriptions from element in Dart

i have a lot of objects in game which can be clicked or dragged. In one phase of game i need remove some interactions, I know that there is StreamSubscription.cancel() but this require lot of code to store subscriptions somewhere separately and cancel them whenever its needed. Is there any simple way to clear subscriptions assigned to element "without knowing them"?

Upvotes: 1

Views: 470

Answers (1)

Florian Loitsch
Florian Loitsch

Reputation: 8128

No. You have to keep the subscriptions around.

If it is something that you do frequently you could consider creating abstractions that do it for you.

Upvotes: 2

Related Questions