Skip to content

Commit

Permalink
fix: updated chopper interceptor API
Browse files Browse the repository at this point in the history
  • Loading branch information
jhomlala committed Nov 12, 2023
1 parent 4c30808 commit 541d6bf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 0.4.0
* [BREAKING_CHANGE] Updated dart min version to 3.0.0.
* [BREAKING_CHANGE] Removed `darkTheme` parameter. Alice will now automatically detect the color scheme.
* [BREAKING_CHANGE] Alice will now return chopper interceptor instance instead of list with that interceptor.
* Updated dependencies.
* Fixed lints.
* Updated example.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ If you're using Chopper. you need to add interceptor:

```dart
chopper = ChopperClient(
interceptors: alice.getChopperInterceptor(),
interceptors: [alice.getChopperInterceptor()],
);
```

Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _MyAppState extends State<MyApp> {
_dio.interceptors.add(_alice.getDioInterceptor());
_httpClient = HttpClient();
_chopper = ChopperClient(
interceptors: _alice.getChopperInterceptor(),
interceptors: [_alice.getChopperInterceptor()],
);
_postsService = PostsService.create(_chopper);

Expand Down
4 changes: 2 additions & 2 deletions lib/alice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class Alice {
}

/// Get chopper interceptor. This should be added to Chopper instance.
List<ResponseInterceptor> getChopperInterceptor() {
return [AliceChopperInterceptor(_aliceCore)];
ResponseInterceptor getChopperInterceptor() {
return AliceChopperInterceptor(_aliceCore);
}

/// Handle generic http call. Can be used to any http client.
Expand Down

0 comments on commit 541d6bf

Please sign in to comment.