diff --git a/CHANGELOG.md b/CHANGELOG.md index b84911aa..c2245e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index a1cc2969..065a7cca 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ If you're using Chopper. you need to add interceptor: ```dart chopper = ChopperClient( - interceptors: alice.getChopperInterceptor(), + interceptors: [alice.getChopperInterceptor()], ); ``` diff --git a/example/lib/main.dart b/example/lib/main.dart index 03cf7136..1a8d6b1a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -41,7 +41,7 @@ class _MyAppState extends State { _dio.interceptors.add(_alice.getDioInterceptor()); _httpClient = HttpClient(); _chopper = ChopperClient( - interceptors: _alice.getChopperInterceptor(), + interceptors: [_alice.getChopperInterceptor()], ); _postsService = PostsService.create(_chopper); diff --git a/lib/alice.dart b/lib/alice.dart index 53548616..836438ca 100644 --- a/lib/alice.dart +++ b/lib/alice.dart @@ -108,8 +108,8 @@ class Alice { } /// Get chopper interceptor. This should be added to Chopper instance. - List getChopperInterceptor() { - return [AliceChopperInterceptor(_aliceCore)]; + ResponseInterceptor getChopperInterceptor() { + return AliceChopperInterceptor(_aliceCore); } /// Handle generic http call. Can be used to any http client.