How to do something before destroying an object in Darth?

In Java, we can do something like overriding finalize (), in C ++ we can do something like ~ Someclass (),

But how can I do this in a dart, I read the document at https://www.dartlang.org/ , but did not find the answers.

+7
destructor dart angular-dart
source share
1 answer

This is not supported. There is nothing like a destructor in Dart.
The JS garbage collector makes it impossible to implement this. See also fooobar.com/questions/828835 / ... and https://github.com/dart-lang/sdk/issues/3691

+3
source share

All Articles