This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 4 files changed +14
-16
lines changed
image_picker/image_picker_platform_interface
4 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,8 @@ import 'dart:typed_data';
11
11
import 'package:flutter_test/flutter_test.dart' ;
12
12
import 'package:cross_file/cross_file.dart' ;
13
13
14
- // Please note that executing this test with command
15
- // `flutter test test/x_file_io_test.dart` will set the directory
16
- // to ./file_selector_platform_interface.
17
- //
18
- // This will cause our hello.txt file to be not be found. Please
19
- // execute this test with `flutter test` or change the path prefix
20
- // to ./test/assets/
21
- //
22
- // https://github.com/flutter/flutter/issues/20907
23
-
24
- final pathPrefix = './assets/' ;
14
+ final pathPrefix =
15
+ Directory .current.path.endsWith ('test' ) ? './assets/' : './test/assets/' ;
25
16
final path = pathPrefix + 'hello.txt' ;
26
17
final String expectedStringContents = 'Hello, world!' ;
27
18
final Uint8List bytes = Uint8List .fromList (utf8.encode (expectedStringContents));
@@ -30,7 +21,7 @@ final String textFilePath = textFile.path;
30
21
31
22
void main () {
32
23
group ('Create with a path' , () {
33
- final file = XFile (textFilePath);
24
+ final XFile file = XFile (textFilePath);
34
25
35
26
test ('Can be read as a string' , () async {
36
27
expect (await file.readAsString (), equals (expectedStringContents));
Original file line number Diff line number Diff line change
1
+ ## 1.1.6
2
+
3
+ * Fix test asset file location.
4
+
1
5
## 1.1.5
2
6
3
7
* Update Flutter SDK constraint.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: A common platform interface for the image_picker plugin.
3
3
homepage : https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_platform_interface
4
4
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
5
5
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6
- version : 1.1.5
6
+ version : 1.1.6
7
7
8
8
dependencies :
9
9
flutter :
Original file line number Diff line number Diff line change @@ -11,14 +11,17 @@ import 'dart:typed_data';
11
11
import 'package:flutter_test/flutter_test.dart' ;
12
12
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart' ;
13
13
14
+ final pathPrefix =
15
+ Directory .current.path.endsWith ('test' ) ? './assets/' : './test/assets/' ;
16
+ final path = pathPrefix + 'hello.txt' ;
14
17
final String expectedStringContents = 'Hello, world!' ;
15
- final Uint8List bytes = utf8.encode (expectedStringContents);
16
- final File textFile = File ('./assets/hello.txt' );
18
+ final Uint8List bytes = Uint8List . fromList ( utf8.encode (expectedStringContents) );
19
+ final File textFile = File (path );
17
20
final String textFilePath = textFile.path;
18
21
19
22
void main () {
20
23
group ('Create with an objectUrl' , () {
21
- final pickedFile = PickedFile (textFilePath);
24
+ final PickedFile pickedFile = PickedFile (textFilePath);
22
25
23
26
test ('Can be read as a string' , () async {
24
27
expect (await pickedFile.readAsString (), equals (expectedStringContents));
You can’t perform that action at this time.
0 commit comments