http_extensions_retry 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

http_extensions : retry #

An [http extension] that retries failed requests.

Usage #

final client = ExtendedClient(
  inner: Client(),
  extensions: [
        logger: Logger("Retry"),
        defaultOptions: RetryOptions(
          const RetryOptions(
      retries: 3, // Number of retries before a failure
      retryInterval: const Duration(seconds: 5), // Interval between each retry
      retryEvaluator: (error, response) => error != null, // Evaluating if a retry is necessary regarding the error or the response. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though). error or response are at least null

0.1.1 #

  • Fixed issues with copied StreamRequests

0.1.0 #

  • Initial version


import 'package:http_extensions/http_extensions.dart';
import 'package:http_extensions_retry/http_extensions_retry.dart';
import 'package:logging/logging.dart';
import 'package:http/http.dart';

main() async {
  // Displaying logs
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) {
    print('${}: ${record.time}: ${record.message}');

  final client = ExtendedClient(
    inner: Client(),
    extensions: [
          logger: Logger("Retry"),
          defaultOptions: RetryOptions(
            retryInterval: const Duration(seconds: 5),

  /// Sending a failing request for 3 times with a 5s interval
  try {
    await client.get("");
  } catch (e) {
    print("End error : $e");

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  http_extensions_retry: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:http_extensions_retry/http_extensions_retry.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Format lib/http_extensions_retry.dart.

Run dartfmt to format lib/http_extensions_retry.dart.

Format lib/src/extension.dart.

Run dartfmt to format lib/src/extension.dart.

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
http ^0.12.0+1 0.12.0+4
http_extensions ^0.1.1 0.1.2
logging ^0.11.3 0.11.4
meta ^1.1.6 1.1.8
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6