Allow side-effect-free functions to be called at compile time (in constants) #29277
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-stale
Closed as the issue or PR is assumed stale
type-enhancement
A request for a change that isn't a bug
I have a class in Flutter (
Flow
) that takes aList<Widget>
and passes a new list to its superclass constructor, the new list consisting of the incoming list mapped in a well-defined manner (each entry is wrapped in an instance of another class). All the information is available to evaluate this entire operation at compile time, and being able to do it then would allow big performance wins (because it would allow us to build the entire widget subtree once as a constant, which would then be==
to itself each time it was referenced and thus we could avoid doing any work rebuilding that part of the tree).The text was updated successfully, but these errors were encountered: