-
Notifications
You must be signed in to change notification settings - Fork 189
Large File Chunked Upload support on Flutter #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks really good, just a couple of things, mainly inconsistency in patterns. Dart's VM/AST is weird, it transverses ELSE to additional if evaluations with look a-head, so if we can return in the if without fall through to an else statement, it might save us a few cycles
params['file'] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.fileName); | ||
res = await client.call(HttpMethod.post, | ||
path: path, params: params, headers: headers); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "else" statement? Perhaps just return "await client.call..." exit quicker to shorten cycles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, good catch. I've made the changes, let me know what you think.
if (size <= Client.CHUNK_SIZE) { | ||
params['file'] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.fileName); | ||
res = await client.call(HttpMethod.post, | ||
path: path, params: params, headers: headers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In service.dart.twig (line 70 - 76) you place each argument on a different line. I like this makes readability super clear. Here, perhaps we could follow the same pattern?
Uh oh!
There was an error while loading. Please reload this page.