Cancellation and progress reporting for one upload operation; progress is reported in bytes.
TxUploadContext
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| cancellation | TxCancellation | required | Cooperative cancellation token. |
| onProgress | void Function(int loaded, int total) | required | Reports completed bytes and total size. |
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
final context = TxUploadContext(cancellation: TxCancellation(), onProgress: (loaded, total) => print(loaded));
context.onProgress(10, 20);
}