Pakete, Repositories und App-Kategorien suchen

GitHub-RepositorySunnatilloShavkatov/dio_retry_plus

dio_retry_plus

SunnatilloShavkatov/dio_retry_plus open-source repository details.

Projektcover von dio_retry_plus
Sterne
2
Forks
1
Letzter Push (UTC)
02.04.2025
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

dio_retry_plus

A plugin for dio that retries failed requests.

Usage

import 'package:dio_retry_plus/dio_retry_plus.dart';
Basic configuration
final dio = Dio()
  ..interceptors.add(RetryInterceptor());
Global retry options
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)
    )
  )
);
Sending a request with options
final response = await dio.get("http://www.flutter.dev", options: Options(
    extra: RetryOptions(
      retryInterval: const Duration(seconds: 10),
    ).toExtra(),
  ));
Sending a request without retry
final response = await dio.get("http://www.flutter.dev", options: Options(
    extra: RetryOptions.noRetry().toExtra(),
  ));
Logging retry operations
final dio = Dio()
  ..interceptors.add(RetryInterceptor(logger: Logger("Retry")));

Features and bugs

Please file issues.

Sunnatillo Shavkatov GitHub avatar
GitHub-Autor

Sunnatillo Shavkatov ↗

BeelabTashkent City
SprachenDart

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 4 Einträge

  • flutter{"sdk":"flutter"}
  • dio^5.8.0+1
  • flutter_testEntwicklung{"sdk":"flutter"}
  • flutter_lintsEntwicklung^5.0.0

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗