Skip to content

Commit

Permalink
Merge pull request #36 from binSaed/feature/const_extra
Browse files Browse the repository at this point in the history
fix disableRetry if extra is const
  • Loading branch information
rodion-m authored Oct 26, 2023
2 parents 810d213 + 4dcd959 commit b2c0c78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/src/retry_interceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ extension RequestOptionsX on RequestOptions {
extension OptionsX on Options {
bool get disableRetry => (extra?[_kDisableRetryKey] as bool?) ?? false;

set disableRetry(bool value) =>
(extra ??= <String, dynamic>{})[_kDisableRetryKey] = value;
set disableRetry(bool value) {
extra = Map.of(extra ??= <String, dynamic>{});
extra![_kDisableRetryKey] = value;
}
}

0 comments on commit b2c0c78

Please sign in to comment.