Skip to content

Commit 70cdbf9

Browse files
authored
fix: update onReceiveProgress references in docs (#1732)
<!-- Write down your pull request descriptions. --> ### New Pull Request Checklist - [x] I have read the [Documentation](https://pub.dev/documentation/dio/latest/) - [x] I have searched for a similar pull request in the [project](https://github.com/cfug/dio/pulls) and found none - [x] I have updated this branch with the latest `main` branch to avoid conflicts (via merge from master or rebase) - [ ] I have added the required tests to prove the fix/feature I'm adding - [x] I have updated the documentation (if necessary) - [ ] I have run the tests without failures - [ ] I have updated the `CHANGELOG.md` in the corresponding package ### Additional context and info (if any) <!-- Provide more context and info about the PR. --> Small update on the docs making reference to `onProgress` instead of `onReceiveProgress` --------- Signed-off-by: Carlos Gutiérrez Moreno <carlosgutimo.3d@gmail.com>
1 parent e25aae6 commit 70cdbf9

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

dio/lib/src/dio.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ abstract class Dio {
208208
///
209209
/// [lengthHeader] : The real size of original file (not compressed).
210210
/// When file is compressed:
211-
/// 1. If this value is 'content-length', the `total` argument of `onProgress` will be -1
211+
/// 1. If this value is 'content-length', the `total` argument of [onReceiveProgress] will be -1
212212
/// 2. If this value is not 'content-length', maybe a custom header indicates the original
213-
/// file size , the `total` argument of `onProgress` will be this header value.
213+
/// file size , the `total` argument of [onReceiveProgress] will be this header value.
214214
///
215215
/// You can also disable the compression by specifying
216216
/// the 'accept-encoding' header value as '*' to assure the value of
217-
/// `total` argument of `onProgress` is not -1. for example:
217+
/// `total` argument of [onReceiveProgress] is not -1. for example:
218218
///
219219
/// ```dart
220220
/// await dio.download(
@@ -223,7 +223,7 @@ abstract class Dio {
223223
/// options: Options(
224224
/// headers: {HttpHeaders.acceptEncodingHeader: "*"}, // Disable gzip
225225
/// ),
226-
/// onProgress: (received, total) {
226+
/// onReceiveProgress: (received, total) {
227227
/// if (total != -1) {
228228
/// print((received / total * 100).toStringAsFixed(0) + "%");
229229
/// }

dio/lib/src/options.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enum ResponseType {
2424
json,
2525

2626
/// Get the response stream without any transformation. The
27-
/// Response data will be a `ResponseBody` instance.
27+
/// Response data will be a [ResponseBody] instance.
2828
///
2929
/// Response<ResponseBody> rs = await Dio().get<ResponseBody>(
3030
/// url,
@@ -402,8 +402,8 @@ class Options {
402402
/// that's to say the type of [Response.data] will be List<int>, use `bytes`
403403
ResponseType? responseType;
404404

405-
/// `validateStatus` defines whether the request is successful for a given
406-
/// HTTP response status code. If `validateStatus` returns `true` ,
405+
/// [validateStatus] defines whether the request is successful for a given
406+
/// HTTP response status code. If [validateStatus] returns `true` ,
407407
/// the request will be perceived as successful; otherwise, considered as failed.
408408
ValidateStatus? validateStatus;
409409

dio/lib/src/response.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Response<T> {
5656
Uri get realUri =>
5757
redirects.isNotEmpty ? redirects.last.location : requestOptions.uri;
5858

59-
/// We are more concerned about `data` field.
59+
/// We are more concerned about [data] field.
6060
@override
6161
String toString() {
6262
if (data is Map) {

dio/lib/src/transformer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import 'utils.dart';
1313
/// request/response data, you can provide a [Transformer] by your self, and
1414
/// replace the [DefaultTransformer] by setting the [dio.Transformer].
1515
abstract class Transformer {
16-
/// `transformRequest` allows changes to the request data before it is
16+
/// [transformRequest] allows changes to the request data before it is
1717
/// sent to the server, but **after** the [RequestInterceptor].
1818
///
1919
/// This is only applicable for request methods 'PUT', 'POST', and 'PATCH'
2020
Future<String> transformRequest(RequestOptions options);
2121

22-
/// `transformResponse` allows changes to the response data before
22+
/// [transformResponse] allows changes to the response data before
2323
/// it is passed to [ResponseInterceptor].
2424
///
2525
/// **Note**: As an agreement, you must return the [response]

0 commit comments

Comments
 (0)