Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const copyFile = async () => {
}
});
} catch (error) {
console.error('Error', err);
console.error('Error', error);
}
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ const { body, eTag } = await downloadData(
{
path: 'album/2024/1.jpg',
options: {
onProgress: (progress) {
onProgress: (progress) => {
console.log(`Download progress: ${(progress.transferredBytes/progress.totalBytes) * 100}%`);
}
}
Expand Down Expand Up @@ -956,7 +956,7 @@ download
```dart
final operation = Amplify.Storage.downloadData(
path: const StoragePath.fromString('public/example.txt'),
onProgress: (progress) {
onProgress: (progress) => {
Copy link
Contributor

@sarayev sarayev Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik, arrow syntax (=>) is not required for the function definitions where the function body is implemented between curly brackets {} in dart. Where does these cause syntax errors?

Copy link
Contributor Author

@osama-rizk osama-rizk Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copy pasted the code samples and I find an error. Please check the following sandbox app that have the sample code with out the fix. https://codesandbox.io/p/devbox/65nxnl?file=%2Fsrc%2FApp.jsx%3A17%2C1-18%2C1 . Putting an arrow operator should fix the issue

Copy link
Contributor Author

@osama-rizk osama-rizk Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the dart syntax change.

safePrint('fraction totalBytes: ${progress.totalBytes}');
safePrint('fraction transferredBytes: ${progress.transferredBytes}');
safePrint('fraction completed: ${progress.fractionCompleted}');
Expand Down