takeList method
Copy the underlying data as a list. And destroy() itself at the same time.
Implementation
Uint8List? takeList() {
if (_ptr != null && _ptr != nullptr) {
final list = Uint8List.fromList(asList()!);
destroy();
return list;
}
return null;
}