Skip to content

Commit

Permalink
up major version
Browse files Browse the repository at this point in the history
  • Loading branch information
rodich66 committed Sep 30, 2024
1 parent fd418da commit 139fc51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 7.0.0
- [BREAKING CHANGE] `MultipartFileRecreatable` removed. Use a regular `MultipartFile` instead of `MultipartFileRecreatable`.

## 6.0.0
- Updated internal libraries.
- Bumped minimum Dart SDK to 3.0.
Expand Down
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,9 @@ dio.interceptors.add(
await dio.get<dynamic>('https://mock.codes/400');
```

## Retry requests with `multipart/form-data`
Because dio's class for multipart data `MultipartFile` doesn't support stream rewinding (recreation) to support retry for multipart data you should use a class `MultipartFileRecreatable` instead of `MultipartFile`. \
Here is an example:
```dart
final formData =
FormData.fromMap({'file': MultipartFileRecreatable.fromFileSync('README.md')});
await dio.post<dynamic>(
'https://multipart.free.beeceptor.com/post500',
data: formData,
);
```
See the full example in the test: https://github.com/rodion-m/dio_smart_retry/blob/63a3bddae8b5a0581c35c4ae5e973996561d9100/test/multipart_retry_tests.dart#L32-L61
## Migrating to 7.0

Use `MultipartFile` instead of `MultipartFileRecreatable`.

## Migrating to 6.0

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dio_smart_retry
description: Retry library for Dio and Dio package made with love. By default, the request will be retried only for appropriate retryable http statuses.
version: 6.0.0
version: 7.0.0
repository: https://github.com/rodion-m/dio_smart_retry
issue_tracker: https://github.com/rodion-m/dio_smart_retry/issues
homepage: https://github.com/rodion-m/dio_smart_retry
Expand Down

0 comments on commit 139fc51

Please sign in to comment.