MiniProgramFileTransferProgress constructor
MiniProgramFileTransferProgress({
- required String transferId,
- required MiniProgramFileTransferDirection direction,
- required MiniProgramFileTransferStatus status,
- required int bytesTransferred,
- int? totalBytes,
- String? fileName,
Implementation
MiniProgramFileTransferProgress({
required String transferId,
required this.direction,
required this.status,
required this.bytesTransferred,
this.totalBytes,
String? fileName,
}) : transferId = _requiredFileString(transferId, 'transferId'),
fileName = _optionalFileString(fileName, 'fileName') {
if (bytesTransferred < 0) {
throw const FormatException('bytesTransferred must not be negative.');
}
if (totalBytes != null && totalBytes! < 0) {
throw const FormatException('totalBytes must not be negative.');
}
if (totalBytes != null && bytesTransferred > totalBytes!) {
throw const FormatException('bytesTransferred cannot exceed totalBytes.');
}
}