exponentialBackoffRetryConfigSerializer top-level property

JsonSerializer<ExponentialBackoffRetryConfig> exponentialBackoffRetryConfigSerializer
final

Implementation

final exponentialBackoffRetryConfigSerializer = JsonSerializer(
  fromJson: (json) {
    return ExponentialBackoffRetryConfig(
      maxRetries: json['maxRetries'] as int,
      delay: Duration(milliseconds: json['delay'] as int),
      multiplier: json['multiplier'] as double,
    );
  },
  toJson: (config) {
    return {
      'maxRetries': config.maxRetries,
      'delay': config.delay.inMilliseconds,
      'multiplier': config.multiplier,
    };
  },
);