'how can I prevent class and its members from being tree shaken?

I would like to make sure that a class and all its members are not tree shaken when compiled with Dart2JS.

There used to be a MirrorsUsed annotation but that is long gone.

Anyway to do that nowadays without having to create an object of the class and using its members?

Maybe a Pragma annotation?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source