2

I have a long-lived object in my Dart app, created using the output of several computationally expensive functions. Often, I change these expensive functions - but because their output is cached, I cannot see the results of my changes without restarting the app.

Is there a way (perhaps using a Dart VM API) to respond to a Hot Reload and recreate my object accordingly?

Note: I am looking for a solution that does not depend on the Flutter framework, as the relevant code is in a standalone Dart package.

hacker1024
  • 3,186
  • 1
  • 11
  • 31
  • 1
    Just as a note, I attempted to create a solution for you but got into a possible issue (or just me not knowing how the `vm_service` are suppose to work... :P). I have created the following issue including an example on how I think we should be able to be notified about hot reloads, but which does not work currently: https://github.com/dart-lang/sdk/issues/49491 – julemand101 Jul 21 '22 at 09:20

0 Answers0