v2.0.8
dio_retry_plus
डायो के लिए एक प्लगइन जो असफल अनुरोधों को दोहराता है।
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 ↗