onClose method

ProviderDefinition<T> onClose(
  1. void onDispose(
    1. T value
    )
)

OnCloseCallback is called when definition is closed.

Implementation

ProviderDefinition<T> onClose(void Function(T value) onDispose) {
  var scopeDefinitionCopy = copy(onDispose: Callback(callback: onDispose));
  scopeDefinition.remove(this);
  scopeDefinition.save(scopeDefinitionCopy);
  return scopeDefinitionCopy;
}