File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1+ import 'dart:async' ;
2+
13import 'package:http/http.dart' ;
24
35///Interceptor interface to create custom Interceptor for http.
@@ -26,11 +28,11 @@ import 'package:http/http.dart';
2628///}
2729///```
2830abstract class InterceptorContract {
29- Future <bool > shouldInterceptRequest () async => true ;
31+ FutureOr <bool > shouldInterceptRequest () => true ;
3032
31- Future <BaseRequest > interceptRequest ({required BaseRequest request});
33+ FutureOr <BaseRequest > interceptRequest ({required BaseRequest request});
3234
33- Future <bool > shouldInterceptResponse () async => true ;
35+ FutureOr <bool > shouldInterceptResponse () => true ;
3436
35- Future <BaseResponse > interceptResponse ({required BaseResponse response});
37+ FutureOr <BaseResponse > interceptResponse ({required BaseResponse response});
3638}
Original file line number Diff line number Diff line change @@ -36,14 +36,13 @@ import 'package:http/http.dart';
3636abstract class RetryPolicy {
3737 /// Defines whether the request should be retried when an Exception occurs
3838 /// while making said request to the server.
39- Future <bool > shouldAttemptRetryOnException (
40- Exception reason, BaseRequest request) async =>
39+ FutureOr <bool > shouldAttemptRetryOnException (
40+ Exception reason, BaseRequest request) =>
4141 false ;
4242
4343 /// Defines whether the request should be retried after the request has
4444 /// received `response` from the server.
45- Future <bool > shouldAttemptRetryOnResponse (BaseResponse response) async =>
46- false ;
45+ FutureOr <bool > shouldAttemptRetryOnResponse (BaseResponse response) => false ;
4746
4847 /// Number of maximum request attempts that can be retried.
4948 final int maxRetryAttempts = 1 ;
You can’t perform that action at this time.
0 commit comments