diff --git a/lib/src/network_request.dart b/lib/src/network_request.dart index e678ef1..96757c5 100644 --- a/lib/src/network_request.dart +++ b/lib/src/network_request.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:sturdy_http/src/retry_behavior.dart'; import 'package:sturdy_http/sturdy_http.dart'; part 'network_request.freezed.dart'; diff --git a/lib/src/sturdy_http.dart b/lib/src/sturdy_http.dart index e69f182..bd2a511 100644 --- a/lib/src/sturdy_http.dart +++ b/lib/src/sturdy_http.dart @@ -4,7 +4,6 @@ import 'dart:isolate'; import 'package:collection/collection.dart'; import 'package:dio/dio.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:sturdy_http/src/retry_behavior.dart'; import 'package:sturdy_http/sturdy_http.dart'; import 'package:uuid/uuid.dart'; diff --git a/lib/sturdy_http.dart b/lib/sturdy_http.dart index 7d4fd7c..2ae67b3 100644 --- a/lib/sturdy_http.dart +++ b/lib/sturdy_http.dart @@ -5,3 +5,4 @@ export 'src/sturdy_http.dart'; export 'src/sturdy_http_event_listener.dart'; export 'src/network_request.dart'; export 'src/network_response.dart'; +export 'src/retry_behavior.dart'; diff --git a/test/src/sturdy_http_test.dart b/test/src/sturdy_http_test.dart index 8e5a8f7..8b9dd92 100644 --- a/test/src/sturdy_http_test.dart +++ b/test/src/sturdy_http_test.dart @@ -3,10 +3,8 @@ import 'dart:io'; import 'package:charlatan/charlatan.dart'; import 'package:dio/dio.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:sturdy_http/src/retry_behavior.dart' as rb; -import 'package:sturdy_http/src/retry_behavior.dart'; import 'package:sturdy_http/sturdy_http.dart'; -import 'package:test/test.dart'; +import 'package:test/test.dart' hide Retry; part 'sturdy_http_test.freezed.dart'; part 'sturdy_http_test.g.dart'; @@ -42,7 +40,7 @@ void main() { List interceptors = const [], Map? proxy, bool inferContentType = false, - rb.RetryBehavior retryBehavior = const rb.NeverRetry(), + RetryBehavior retryBehavior = const NeverRetry(), }) { return SturdyHttp( baseUrl: baseUrl, @@ -832,7 +830,7 @@ void main() { await buildSubject().execute>( const GetRequest( defaultPath, - retryBehavior: rb.Retry( + retryBehavior: Retry( maxRetries: 3, retryInterval: Duration(milliseconds: 100), ), @@ -875,7 +873,7 @@ void main() { await buildSubject().execute>( const GetRequest( defaultPath, - retryBehavior: rb.NeverRetry(), + retryBehavior: NeverRetry(), ), onResponse: (response) { return response.maybeWhen( @@ -911,11 +909,11 @@ void main() { ); final response = await buildSubject( - retryBehavior: rb.NeverRetry(), + retryBehavior: NeverRetry(), ).execute>( const GetRequest( defaultPath, - retryBehavior: rb.Retry( + retryBehavior: Retry( maxRetries: 2, retryInterval: Duration(milliseconds: 100), ), @@ -955,11 +953,11 @@ void main() { ); final response = await buildSubject( - retryBehavior: rb.NeverRetry(), + retryBehavior: NeverRetry(), ).execute>( GetRequest( defaultPath, - retryBehavior: rb.Retry( + retryBehavior: Retry( maxRetries: 2, retryInterval: Duration(milliseconds: 100), retryClause: (r) {