onClean method

void onClean(
  1. void onClean()
)

Provide a callback which the framework will call before next create call and when the creator is disposed.

Implementation

void onClean(void Function() onClean) {
  assert(_owner != null, 'onClean is called outside of create method');
  _clean[_owner!] = onClean;
}