diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 5d871fa6..3e3e875c 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,3 +1,9 @@ +## [8.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-8.0.0...flutter-8.1.0) (2024-11-28) + +### Features + +* Add access client in parse clients ([#1025](https://github.com/parse-community/Parse-SDK-Flutter/pull/1025)) + ## [8.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-7.0.1...dart-8.0.0) (2024-10-17) ### BREAKING CHANGES diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index 5136d4c5..931cd1be 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of '../../parse_server_sdk.dart'; // Library -const String keySdkVersion = '8.0.0'; +const String keySdkVersion = '8.1.0'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/lib/src/network/parse_dio_client.dart b/packages/dart/lib/src/network/parse_dio_client.dart index 04842de9..00ba734e 100644 --- a/packages/dart/lib/src/network/parse_dio_client.dart +++ b/packages/dart/lib/src/network/parse_dio_client.dart @@ -14,6 +14,8 @@ class ParseDioClient extends ParseClient { late _ParseDioClient _client; + dio.Dio get dioClient => _client; + @override Future get( String path, { diff --git a/packages/dart/lib/src/network/parse_http_client.dart b/packages/dart/lib/src/network/parse_http_client.dart index cf21724b..99f8dd69 100644 --- a/packages/dart/lib/src/network/parse_http_client.dart +++ b/packages/dart/lib/src/network/parse_http_client.dart @@ -18,6 +18,8 @@ class ParseHTTPClient extends ParseClient { late _ParseHTTPClient _client; + http.BaseClient get httpClient => _client; + Map? get additionalHeaders => _client.additionalHeaders; set additionalHeaders(Map? additionalHeaders) => diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index ae668f69..3af44bf6 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -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: 8.0.0 +version: 8.1.0 homepage: https://parseplatform.org repository: https://github.com/parse-community/Parse-SDK-Flutter issue_tracker: https://github.com/parse-community/Parse-SDK-Flutter/issues diff --git a/packages/dart/test/src/network/parse_dio_client_test.dart b/packages/dart/test/src/network/parse_dio_client_test.dart new file mode 100644 index 00000000..c3e46246 --- /dev/null +++ b/packages/dart/test/src/network/parse_dio_client_test.dart @@ -0,0 +1,28 @@ +import 'package:dio/dio.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('ParseDioClient Tests', () { + late ParseDioClient parseDioClient; + + setUp(() async { + parseDioClient = ParseDioClient(); + }); + + test('should return an instance of Dio from dioClient', () { + // arrange + final dioClient = parseDioClient.dioClient; + + // assert + expect(dioClient, isNotNull); + expect(dioClient, isA()); + }); + }); +} diff --git a/packages/dart/test/src/network/parse_http_client_test.dart b/packages/dart/test/src/network/parse_http_client_test.dart new file mode 100644 index 00000000..d879c4cc --- /dev/null +++ b/packages/dart/test/src/network/parse_http_client_test.dart @@ -0,0 +1,28 @@ +import 'package:http/http.dart' as http; +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('ParseDioClient Tests', () { + late ParseHTTPClient parseHTTPClient; + + setUp(() async { + parseHTTPClient = ParseHTTPClient(); + }); + + test('should return an instance of Dio from dioClient', () { + // arrange + final dioClient = parseHTTPClient.httpClient; + + // assert + expect(dioClient, isNotNull); + expect(dioClient, isA()); + }); + }); +}