Skip to content

Commit 406ce74

Browse files
authored
Add "base", "final" and "interface" modifiers (#920)
1 parent 61dcb91 commit 406ce74

File tree

8 files changed

+84
-52
lines changed

8 files changed

+84
-52
lines changed

.github/workflows/dart.yml

Lines changed: 73 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/http/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.0
2+
3+
* Requires Dart 3.0 or later.
4+
* Add `base`, `final`, and `interface` modifiers to some classes.
5+
16
## 0.13.6
27

38
* `BrowserClient` throws an exception if `send` is called after `close`.

pkgs/http/lib/retry.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'http.dart';
1414
/// NOTE: [RetryClient] makes a copy of the request data in order to support
1515
/// resending it. This can cause a lot of memory usage when sending a large
1616
/// [StreamedRequest].
17-
class RetryClient extends BaseClient {
17+
final class RetryClient extends BaseClient {
1818
/// The wrapped client.
1919
final Client _inner;
2020

pkgs/http/lib/src/base_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'streamed_response.dart';
1717
///
1818
/// This is a mixin-style class; subclasses only need to implement [send] and
1919
/// maybe [close], and then they get various convenience methods for free.
20-
abstract class BaseClient implements Client {
20+
abstract mixin class BaseClient implements Client {
2121
@override
2222
Future<Response> head(Uri url, {Map<String, String>? headers}) =>
2323
_sendUnstreamed('HEAD', url, headers);

pkgs/http/lib/src/byte_stream.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'dart:convert';
77
import 'dart:typed_data';
88

99
/// A stream of chunks of bytes representing a single piece of data.
10-
class ByteStream extends StreamView<List<int>> {
10+
final class ByteStream extends StreamView<List<int>> {
1111
const ByteStream(super.stream);
1212

1313
/// Returns a single-subscription byte stream that will emit the given bytes

pkgs/http/lib/src/client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import 'streamed_response.dart';
2929
/// extend [BaseClient] rather than [Client]. In most cases, you can wrap
3030
/// another instance of [Client] and add functionality on top of that. This
3131
/// allows all classes implementing [Client] to be mutually composable.
32-
abstract class Client {
32+
abstract interface class Client {
3333
/// Creates a new platform appropriate client.
3434
///
3535
/// Creates an `IOClient` if `dart:io` is available and a `BrowserClient` if

pkgs/http/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A composable, multi-platform, Future-based API for HTTP requests.
44
repository: https://github.com/dart-lang/http/tree/master/pkgs/http
55

66
environment:
7-
sdk: '>=2.19.0 <3.0.0'
7+
sdk: '>=3.0.0-417.4.beta <4.0.0'
88

99
dependencies:
1010
async: ^2.5.0

tool/ci.sh

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)