consume method
T?
consume()
Retrieves and clears the stored content.
Returns the stored content if it hasn't been accessed yet, otherwise null. After calling this method, the content is cleared and can't be accessed again.
Implementation
T? consume() {
final data = _data;
_data = null;
return data;
}