putString method
UploadTaskForAll
putString(
- String data, {
- PutStringFormat format = PutStringFormat.raw,
- SettableMetadata? metadata,
Implementation
UploadTaskForAll putString(
String data, {
PutStringFormat format = PutStringFormat.raw,
storage.SettableMetadata? metadata,
}) {
if (_ref_original != null) {
UploadTaskForAll task = UploadTaskForAll();
task.setDownloadingStream = _ref_original!
.putString(data,
format: putStringFormatConverterOriginal(format),
metadata: metadata)
.snapshotEvents
.listen((taskSnapshot) {
task.updateTask(ProcessTask(
processed: taskSnapshot.bytesTransferred,
total: taskSnapshot.totalBytes,
state: taskStateConverterOriginal(taskSnapshot.state)));
}, onError: (e, stackTrace) {
task.addError(e, stackTrace);
});
return task;
} else {
UploadTaskForAll task = UploadTaskForAll();
firebase_dart.SettableMetadata? metadataTmp;
if (metadata != null) {
metadataTmp = firebase_dart.SettableMetadata(
cacheControl: metadata.cacheControl,
contentDisposition: metadata.cacheControl,
contentEncoding: metadata.contentEncoding,
contentLanguage: metadata.contentLanguage,
contentType: metadata.contentType,
customMetadata: metadata.customMetadata);
}
task.setDownloadingStream = _ref_windows!
.putString(data,
format: putStringFormatConverterWindows(format),
metadata: metadataTmp)
.snapshotEvents
.listen((taskSnapshot) {
task.updateTask(ProcessTask(
processed: taskSnapshot.bytesTransferred,
total: taskSnapshot.totalBytes,
state: taskStateConverterWindows(taskSnapshot.state)));
}, onError: (e, stackTrace) {
task.addError(e, stackTrace);
});
return task;
}
}