Skip to content

Commit 2876168

Browse files
authored
fix: Select input name instead of file in ParseFile (#1012)
1 parent 3274981 commit 2876168

File tree

7 files changed

+48
-4
lines changed

7 files changed

+48
-4
lines changed

packages/dart/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [7.0.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-7.0.0...dart-7.0.1) (2024-10-16)
2+
3+
### Bug Fixes
4+
5+
* Select input name instead of file in `ParseFile` ([#1012](https://github.com/parse-community/Parse-SDK-Flutter/pull/1012))
6+
17
## [7.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-6.4.0...dart-7.0.0) (2024-04-12)
28

39
### BREAKING CHANGES

packages/dart/lib/src/base/parse_constants.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of '../../parse_server_sdk.dart';
22

33
// Library
4-
const String keySdkVersion = '7.0.0';
4+
const String keySdkVersion = '7.0.1';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

packages/dart/lib/src/objects/parse_file.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ParseFile extends ParseFileBase {
1111
super.client,
1212
super.autoSendSessionId})
1313
: super(
14-
name: file != null ? path.basename(file.path) : name!,
14+
name: name ?? path.basename(file?.path ?? ''),
1515
);
1616

1717
File? file;

packages/dart/lib/src/objects/parse_x_file.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ParseXFile extends ParseFileBase {
1111
super.client,
1212
super.autoSendSessionId})
1313
: super(
14-
name: file != null ? path.basename(file.path) : name!,
14+
name: name ?? path.basename(file?.path ?? ''),
1515
);
1616

1717
XFile? file;

packages/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: parse_server_sdk
22
description: The Dart SDK to connect to Parse Server. Build your apps faster with Parse Platform, the complete application stack.
3-
version: 7.0.0
3+
version: 7.0.1
44
homepage: https://parseplatform.org
55
repository: https://github.com/parse-community/Parse-SDK-Flutter
66
issue_tracker: https://github.com/parse-community/Parse-SDK-Flutter/issues
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'dart:io';
2+
import 'package:parse_server_sdk/parse_server_sdk.dart';
3+
import 'package:test/test.dart';
4+
5+
import '../../test_utils.dart';
6+
7+
void main() {
8+
setUpAll(() async {
9+
await initializeParse();
10+
});
11+
12+
group('Parse X File', () {
13+
test('should return a correct name', () {
14+
File file = File('/sdcard/aa/aa.jpg');
15+
final parseFile = ParseFile(file, name: 'bb.jpg');
16+
expect(parseFile.name, 'bb.jpg');
17+
});
18+
});
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:cross_file/cross_file.dart';
2+
import 'package:parse_server_sdk/parse_server_sdk.dart';
3+
import 'package:test/test.dart';
4+
5+
import '../../test_utils.dart';
6+
7+
void main() {
8+
setUpAll(() async {
9+
await initializeParse();
10+
});
11+
12+
group('Parse X File', () {
13+
test('should return a correct name', () {
14+
XFile file = XFile('/sdcard/aa/aa.jpg');
15+
final parseFile = ParseXFile(file, name: 'bb.jpg');
16+
expect(parseFile.name, 'bb.jpg');
17+
});
18+
});
19+
}

0 commit comments

Comments
 (0)