Skip to content

Commit 3883717

Browse files
authored
Fix newly enforced package:pedantic lints (#348)
- always_declare_return_types - use_function_type_syntax_for_parameters
1 parent afcbd57 commit 3883717

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

example/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:convert' as convert;
22
import 'package:http/http.dart' as http;
33

4-
main(List<String> arguments) async {
4+
void main(List<String> arguments) async {
55
// This example uses the Google Books API to search for books about http.
66
// https://developers.google.com/books/docs/overview
77
var url = 'https://www.googleapis.com/books/v1/volumes?q={http}';

lib/http.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Future<String> read(url, {Map<String, String> headers}) =>
160160
Future<Uint8List> readBytes(url, {Map<String, String> headers}) =>
161161
_withClient((client) => client.readBytes(url, headers: headers));
162162

163-
Future<T> _withClient<T>(Future<T> fn(Client client)) async {
163+
Future<T> _withClient<T>(Future<T> Function(Client) fn) async {
164164
var client = Client();
165165
try {
166166
return await fn(client);

lib/src/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ByteStream toByteStream(Stream<List<int>> stream) {
6969
///
7070
/// The return value, also a single-subscription [Stream] should be used in
7171
/// place of [stream] after calling this method.
72-
Stream<T> onDone<T>(Stream<T> stream, void onDone()) =>
72+
Stream<T> onDone<T>(Stream<T> stream, void Function() onDone) =>
7373
stream.transform(StreamTransformer.fromHandlers(handleDone: (sink) {
7474
sink.close();
7575
onDone();

test/io/http_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:test/test.dart';
99

1010
import 'utils.dart';
1111

12-
main() {
12+
void main() {
1313
group('http.', () {
1414
setUp(startServer);
1515

0 commit comments

Comments
 (0)