File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,10 @@ abstract class RandomAccessSource {
6161 Future <void > close ();
6262
6363 /// Restores the position after executing the given [action] .
64- Future <void > restorePosition <T >(Future <T > Function () action) async {
64+ Future <T > restorePosition <T >(Future <T > Function () action) async {
6565 final currentPosition = await position ();
6666 try {
67- await action ();
67+ return await action ();
6868 } finally {
6969 await seek (currentPosition);
7070 }
Original file line number Diff line number Diff line change 11name : random_access_source
22description : A shared interface for common random access data.
3- version : 4.2.0
3+ version : 4.2.1
44repository : https://github.com/flutter-cavalry/random_access_source
55
66environment :
Original file line number Diff line number Diff line change @@ -115,12 +115,14 @@ void main() {
115115 await src.seek (10 );
116116 expect (await src.position (), 10 );
117117
118- await src.restorePosition (() async {
118+ final res1 = await src.restorePosition (() async {
119119 expect (await src.position (), 10 );
120120 expect (await src.readByte (), flutterIcon[10 ]);
121121 expect (await src.position (), 11 );
122+ return 'test1' ;
122123 });
123124 expect (await src.position (), 10 );
125+ expect (res1, 'test1' );
124126
125127 try {
126128 await src.restorePosition (() async {
You can’t perform that action at this time.
0 commit comments