ethanblake4 / dart_eval

Extensible Dart interpreter for Dart with full interop
https://pub.dev/packages/dart_eval
BSD 3-Clause "New" or "Revised" License
334 stars 40 forks source link

Does it support Singleton pattern??? #187

Closed cattlelovegrass closed 9 months ago

cattlelovegrass commented 9 months ago

class HttpManager { static final HttpManager _instance = HttpManager._internal();

factory HttpManager() { return _instance; }

HttpManager._internal(); } if this code implements $Instance, Is it the same as usual?

ethanblake4 commented 9 months ago

You can use the dart_eval binding generator to automatically generate an $Instance wrapper that can do this

cattlelovegrass commented 9 months ago

OK, Thanks