v2.0.8
dio_retry_plus
실패한 요청을 다시 시도하는 dio용 플러그인입니다.
29좋아요 83730일 다운로드120Pub 점수
AndroidiOSWebmacOSWindowsLinux
SunnatilloShavkatov/dio_retry_plus open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A plugin for dio that retries failed requests.
import 'package:dio_retry_plus/dio_retry_plus.dart';
final dio = Dio()
..interceptors.add(RetryInterceptor());
final dio = Dio()
..interceptors.add(RetryInterceptor(
options: const RetryOptions(
retries: 3, // Number of retries before a failure
retryInterval: const Duration(seconds: 1), // Interval between each retry
retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE, // Evaluating if a retry is necessary regarding the error. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though)
)
)
);
final response = await dio.get("http://www.flutter.dev", options: Options(
extra: RetryOptions(
retryInterval: const Duration(seconds: 10),
).toExtra(),
));
final response = await dio.get("http://www.flutter.dev", options: Options(
extra: RetryOptions.noRetry().toExtra(),
));
final dio = Dio()
..interceptors.add(RetryInterceptor(logger: Logger("Retry")));
Please file issues.
의존성 목록 4 개
{"sdk":"flutter"}^5.8.0+1{"sdk":"flutter"}^5.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗