onProgress property
Optional progress callback for streaming writes.
Called periodically with the bytes written so far and the total when
known — totalBytes is null while the total is unknown (streaming
input has no length until it ends).
Progress is reported in the CALLER's byte space: an encrypted write reports plaintext bytes consumed, not ciphertext bytes landed, so a progress bar over the source size stays accurate.
Only meaningful for StorageBackend.writeStream.
Ignored for StorageBackend.write (single buffer, no progress).
Implementation
final void Function(int bytesWritten, int? totalBytes)? onProgress;