Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 30a1d29

Browse files
authored
Update README.md (#131)
Apply Dart style to code in README.md
1 parent a6d1e7a commit 30a1d29

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@ import 'dart:io';
1515
1616
import 'package:http2/http2.dart';
1717
18-
main() async {
19-
var uri = Uri.parse('https://www.google.com/');
18+
Future<void> main() async {
19+
final uri = Uri.parse('https://www.google.com/');
2020
21-
var transport = new ClientTransportConnection.viaSocket(
21+
final transport = ClientTransportConnection.viaSocket(
2222
await SecureSocket.connect(
2323
uri.host,
2424
uri.port,
2525
supportedProtocols: ['h2'],
2626
),
2727
);
2828
29-
var stream = transport.makeRequest(
29+
final stream = transport.makeRequest(
3030
[
31-
new Header.ascii(':method', 'GET'),
32-
new Header.ascii(':path', uri.path),
33-
new Header.ascii(':scheme', uri.scheme),
34-
new Header.ascii(':authority', uri.host),
31+
Header.ascii(':method', 'GET'),
32+
Header.ascii(':path', uri.path),
33+
Header.ascii(':scheme', uri.scheme),
34+
Header.ascii(':authority', uri.host),
3535
],
3636
endStream: true,
3737
);
3838
3939
await for (var message in stream.incomingMessages) {
4040
if (message is HeadersStreamMessage) {
4141
for (var header in message.headers) {
42-
var name = utf8.decode(header.name);
43-
var value = utf8.decode(header.value);
42+
final name = utf8.decode(header.name);
43+
final value = utf8.decode(header.value);
4444
print('Header: $name: $value');
4545
}
4646
} else if (message is DataStreamMessage) {

0 commit comments

Comments
 (0)