Skip to content

Commit

Permalink
feat(native_dio_adapter): bump cronet_http, cupertino_http dependency (
Browse files Browse the repository at this point in the history
…#1735)

<!-- Write down your pull request descriptions. -->

### New Pull Request Checklist

- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [x] I have updated the documentation (if necessary)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [x] I have run the tests without failures
- [x] I have added the required tests to prove the fix/feature I'm
adding
- [x] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

updates cronet_http and cupertino_http dependencies and updates the code
for their breaking changes

---------

Signed-off-by: Martin Kamleithner <martin.kamleithner@gmail.com>
Co-authored-by: Alex Li <github@alexv525.com>
  • Loading branch information
knaeckeKami and AlexV525 committed Mar 13, 2023
1 parent 70cdbf9 commit ba91ed7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
uses: subosito/flutter-action@v2.8.0
with:
cache: true
flutter-version: ${{ matrix.channel == 'min' && '3.3.0' || '' }}
flutter-version: ${{ matrix.channel == 'min' && '3.7.0' || '' }}
channel: ${{ matrix.channel == 'min' && 'stable' || matrix.channel }}
- run: flutter test

Expand Down
1 change: 1 addition & 0 deletions plugins/native_dio_adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Bump cupertino_http and cronet_http versions.
- Improve code formats according to linter rules.

## 0.0.1
Expand Down
3 changes: 1 addition & 2 deletions plugins/native_dio_adapter/lib/native_dio_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ library native_dio_adapter;
export 'src/native_adapter.dart';
export 'src/cronet_adapter.dart';
export 'src/cupertino_adapter.dart';
export 'package:cupertino_http/cupertino_client.dart';
export 'package:cupertino_http/cupertino_http.dart';
export 'package:cronet_http/cronet_client.dart';
export 'package:cronet_http/cronet_http.dart';
6 changes: 4 additions & 2 deletions plugins/native_dio_adapter/lib/src/cronet_adapter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:typed_data';

import 'package:cronet_http/cronet_client.dart';
import 'package:cronet_http/cronet_http.dart';
import 'package:dio/dio.dart';
import 'conversion_layer_adapter.dart';

Expand All @@ -9,7 +9,9 @@ import 'conversion_layer_adapter.dart';
/// [cronet_http](https://pub.dev/packages/cronet_http).
class CronetAdapter implements HttpClientAdapter {
CronetAdapter(CronetEngine? engine)
: _conversionLayer = ConversionLayerAdapter(CronetClient(engine));
: _conversionLayer = ConversionLayerAdapter(engine == null
? CronetClient.defaultCronetEngine()
: CronetClient.fromCronetEngine(engine));

final ConversionLayerAdapter _conversionLayer;

Expand Down
1 change: 0 additions & 1 deletion plugins/native_dio_adapter/lib/src/cupertino_adapter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:typed_data';

import 'package:cupertino_http/cupertino_client.dart';
import 'package:cupertino_http/cupertino_http.dart';
import 'package:dio/dio.dart';
import 'conversion_layer_adapter.dart';
Expand Down
2 changes: 1 addition & 1 deletion plugins/native_dio_adapter/lib/src/native_adapter.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';
import 'dart:typed_data';

import 'package:cronet_http/cronet_client.dart';
import 'package:cronet_http/cronet_http.dart';
import 'package:cupertino_http/cupertino_http.dart';
import 'package:dio/dio.dart';
import 'cronet_adapter.dart';
Expand Down
8 changes: 4 additions & 4 deletions plugins/native_dio_adapter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ repository: https://github.com/cfug/dio/blob/main/plugins/native_dio_adapter
issue_tracker: https://github.com/cfug/dio/issues

environment:
sdk: '>=2.18.0 <3.0.0'
flutter: ">=3.0.0"
sdk: '>=2.19.0 <3.0.0'
flutter: ">=3.7.0"

dependencies:
dio: ^5.0.0
cupertino_http: ^0.0.9
cronet_http: ^0.0.3
cupertino_http: ^0.1.2
cronet_http: ^0.2.0
http: ^0.13.4

dev_dependencies:
Expand Down

0 comments on commit ba91ed7

Please sign in to comment.