t×tecexpressby TeKOcloud
DEv0.7.1
API & types / FLUTTER

TxUploadContext.

Cancellation and progress reporting for one upload operation; progress is reported in bytes.

TxUploadContext

ParameterTypeDefaultMeaning
cancellationTxCancellationrequiredCooperative cancellation token.
onProgressvoid Function(int loaded, int total)requiredReports completed bytes and total size.
dart
import 'package:tecexpress/tecexpress.dart';

Future<void> example() async {
  final context = TxUploadContext(cancellation: TxCancellation(), onProgress: (loaded, total) => print(loaded));
  context.onProgress(10, 20);
}