Skip to content

Commit

Permalink
Merge pull request #719 from appwrite/fix-6304-dart-sdk-create-file-b…
Browse files Browse the repository at this point in the history
…ytes
  • Loading branch information
lohanidamodar authored Sep 25, 2023
2 parents 2dfe043 + e00f337 commit 2069238
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/dart/lib/src/client_browser.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ClientBrowser extends ClientBase with ClientMixin {

while (offset < size) {
var chunk;
final end = min(offset + CHUNK_SIZE - 1, size - 1);
final end = min(offset + CHUNK_SIZE, size);
chunk = file.bytes!.getRange(offset, end).toList();
params[paramName] =
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
Expand Down
2 changes: 1 addition & 1 deletion templates/dart/lib/src/client_io.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ClientIO extends ClientBase with ClientMixin {
while (offset < size) {
List<int> chunk = [];
if (file.bytes != null) {
final end = min(offset + CHUNK_SIZE - 1, size - 1);
final end = min(offset + CHUNK_SIZE, size);
chunk = file.bytes!.getRange(offset, end).toList();
} else {
raf!.setPositionSync(offset);
Expand Down
2 changes: 1 addition & 1 deletion templates/flutter/lib/src/client_browser.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ClientBrowser extends ClientBase with ClientMixin {

while (offset < size) {
var chunk;
final end = min(offset + CHUNK_SIZE - 1, size - 1);
final end = min(offset + CHUNK_SIZE, size);
chunk = file.bytes!.getRange(offset, end).toList();
params[paramName] =
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
Expand Down
2 changes: 1 addition & 1 deletion templates/flutter/lib/src/client_io.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class ClientIO extends ClientBase with ClientMixin {
while (offset < size) {
List<int> chunk = [];
if (file.bytes != null) {
final end = min(offset + CHUNK_SIZE - 1, size - 1);
final end = min(offset + CHUNK_SIZE, size);
chunk = file.bytes!.getRange(offset, end).toList();
} else {
raf!.setPositionSync(offset);
Expand Down

0 comments on commit 2069238

Please sign in to comment.