-
Notifications
You must be signed in to change notification settings - Fork 39
Streaming problem #59
Copy link
Copy link
Open
Description
i want to send an IAsyncEnumerable to server for streaming
and i used multiple of types that all of them not working
my question is : how do i do it?
the code i wrote :
Future<FileResponse<FtmFile?>> upload(UploadFile file) async {
try {
await start();
final request = await _uploadRequest(RequestUpload.fromUploadFile(file));
if (request.status.toLowerCase() == 'success') {
final base64 = base64Encode(file.buffer);
final subject = Stream.fromIterable(_makeChunck(base64));
final response = await _connection?.invoke(_FileMethods.upload, args: [
request.result!,
subject,
]);
return FileResponse<FtmFile?>.fromJson(
response as Map<String, Object?>);
} else {
return FileResponse(
result: null,
status: request.status,
);
}
} catch (e) {
return FileResponse(
result: null,
status: 'fail',
);
} finally {
await _connection?.stop();
}
}
the error i get :
RangeError (RangeError (index): Invalid value: Valid value range is empty: 1)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels