I want to be able to take a string (with the proper Dart syntax) and convert it into a callable dart function. Is there a way to do that?
For example, I would receive the string,
void test() { print("testing!"); }
And then turn it into a callable function. The reason I want to do this is to be able to download dart files from other servers and call their functions.
Per the dart FAQ, https://www.dartlang.org/support/faq.html#q-is-it-really-a-dynamic-language-if-it-doesnt-have-eval-or-adding-fields-to-a-value-at-run-time
Dart does not currently have an eval() function, nor support runtime compilation of arbitrary strings, though it may in the future.
So, you'll have to make your own VM within dart to do what you want to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With