Skip to content

Commit

Permalink
fix(UploadFile): Improve File Opening Performance During Upload (#693)
Browse files Browse the repository at this point in the history
* fix(UploadFile): for an upload, replacement of readAsBytesSync and map methods with openRead only

* style: reformat indent

---------

Co-authored-by: Mehdi Slimani <mslimani@zatsit.fr>
  • Loading branch information
mslimani and Mehdi Slimani authored Jul 12, 2024
1 parent 5e93534 commit b24d210
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1627,12 +1627,10 @@ if (T != dynamic &&
blocks.add(
declareFinal(dataVar)
.assign(
refer('Stream').property('fromIterable').call([
refer(
'${bodyName.displayName}.readAsBytesSync().map((i)=>[i])',
)
]),
)
refer(
'${bodyName.displayName}.openRead()',
),
)
.statement,
);
} else if (bodyName.type.element is ClassElement) {
Expand Down

0 comments on commit b24d210

Please sign in to comment.