Skip to content

Commit

Permalink
fix: Select input name instead of file in ParseFile (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfakourii authored Oct 16, 2024
1 parent 3274981 commit 2876168
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [7.0.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-7.0.0...dart-7.0.1) (2024-10-16)

### Bug Fixes

* Select input name instead of file in `ParseFile` ([#1012](https://github.com/parse-community/Parse-SDK-Flutter/pull/1012))

## [7.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-6.4.0...dart-7.0.0) (2024-04-12)

### BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/base/parse_constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of '../../parse_server_sdk.dart';

// Library
const String keySdkVersion = '7.0.0';
const String keySdkVersion = '7.0.1';
const String keyLibraryName = 'Flutter Parse SDK';

// End Points
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/objects/parse_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ParseFile extends ParseFileBase {
super.client,
super.autoSendSessionId})
: super(
name: file != null ? path.basename(file.path) : name!,
name: name ?? path.basename(file?.path ?? ''),
);

File? file;
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/objects/parse_x_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ParseXFile extends ParseFileBase {
super.client,
super.autoSendSessionId})
: super(
name: file != null ? path.basename(file.path) : name!,
name: name ?? path.basename(file?.path ?? ''),
);

XFile? file;
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: parse_server_sdk
description: The Dart SDK to connect to Parse Server. Build your apps faster with Parse Platform, the complete application stack.
version: 7.0.0
version: 7.0.1
homepage: https://parseplatform.org
repository: https://github.com/parse-community/Parse-SDK-Flutter
issue_tracker: https://github.com/parse-community/Parse-SDK-Flutter/issues
Expand Down
19 changes: 19 additions & 0 deletions packages/dart/test/src/objects/parse_file_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'dart:io';
import 'package:parse_server_sdk/parse_server_sdk.dart';
import 'package:test/test.dart';

import '../../test_utils.dart';

void main() {
setUpAll(() async {
await initializeParse();
});

group('Parse X File', () {
test('should return a correct name', () {
File file = File('/sdcard/aa/aa.jpg');
final parseFile = ParseFile(file, name: 'bb.jpg');
expect(parseFile.name, 'bb.jpg');
});
});
}
19 changes: 19 additions & 0 deletions packages/dart/test/src/objects/parse_x_file_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:cross_file/cross_file.dart';
import 'package:parse_server_sdk/parse_server_sdk.dart';
import 'package:test/test.dart';

import '../../test_utils.dart';

void main() {
setUpAll(() async {
await initializeParse();
});

group('Parse X File', () {
test('should return a correct name', () {
XFile file = XFile('/sdcard/aa/aa.jpg');
final parseFile = ParseXFile(file, name: 'bb.jpg');
expect(parseFile.name, 'bb.jpg');
});
});
}

0 comments on commit 2876168

Please sign in to comment.