rrousselGit / functional_widget

A code generator to write widgets as function without loosing the benefits of classes.
597 stars 46 forks source link

Use `Dill` to eliminate the need of generated code? #59

Closed fzyzcjy closed 4 years ago

fzyzcjy commented 4 years ago

We know that we can use kernel-to-kernel transformation to change the dill (dart intermediate language). There is already some libraries, such as https://github.com/alibaba-flutter/aspectd, which uses this to modify the code during compilation. Therefore, I think we can do the same thing to transform the functional_widgets. :)

P.S. This article explains this technique, but it is only in Chinese...

rrousselGit commented 4 years ago

I'm not familiar with it (nor do I understand Chinese)

Do you mind expanding a bit more on how that would work?

fzyzcjy commented 4 years ago

It is a bit like macros in other languages, and I will try to explain more when having time.