Skip to content

Commit

Permalink
v6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Nov 15, 2024
1 parent c5c3022 commit f9c91e3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [6.4.0] - 2024-11-15

* New `initDio(Dio dio)` method added to `DioApiService`

## [6.3.0] - 2024-11-13

* Update `updateState` to support RouteView paths
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ packages:
path: ".."
relative: true
source: path
version: "6.2.0"
version: "6.4.0"
path:
dependency: transitive
description:
Expand Down
10 changes: 9 additions & 1 deletion lib/networking/dio_api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class DioApiService {
}

DioApiService(BuildContext? context,
{BaseOptions Function(BaseOptions baseOptions)? baseOptions}) {
{BaseOptions Function(BaseOptions baseOptions)? baseOptions,
Dio Function(Dio api)? initDio}) {
_initDio = initDio;
_context = context;
if (baseOptions != null) {
BaseOptions baseOptionsFinal = BaseOptions();
Expand Down Expand Up @@ -188,8 +190,14 @@ class DioApiService {
if (useInterceptors) {
_addInterceptors();
}

if (_initDio != null) {
_api = _initDio!(_api);
}
}

Dio Function(Dio api)? _initDio;

/// Networking class to handle API requests
/// Use the [request] callback to call an API
/// [handleSuccess] overrides the response on a successful status code
Expand Down
3 changes: 2 additions & 1 deletion lib/networking/ny_api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import '/networking/dio_api_service.dart';
import 'package:pretty_dio_logger/pretty_dio_logger.dart';

class NyApiService extends DioApiService {
NyApiService(super.context, {this.decoders = const {}, super.baseOptions});
NyApiService(super.context,
{this.decoders = const {}, super.baseOptions, super.initDio});

/// Map decoders to modelDecoders
@override
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nylo_support
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
version: 6.3.0
version: 6.4.0
homepage: https://nylo.dev
repository: https://github.com/nylo-core/support/tree/6.x
issue_tracker: https://github.com/nylo-core/support/issues
Expand Down

0 comments on commit f9c91e3

Please sign in to comment.