Skip to content

Commit 19f0220

Browse files
committed
Move to pkg:dart_flutter_team_lints, require Dart 2.19
1 parent bb86cf3 commit 19f0220

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+130
-144
lines changed

.github/workflows/dart.yml

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

analysis_options.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:lints/recommended.yaml
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
22

33
analyzer:
44
language:
@@ -9,36 +9,20 @@ analyzer:
99
linter:
1010
rules:
1111
- avoid_bool_literals_in_conditional_expressions
12-
- avoid_catching_errors
1312
- avoid_classes_with_only_static_members
14-
- avoid_dynamic_calls
1513
- avoid_private_typedef_functions
1614
- avoid_returning_this
1715
- avoid_unused_constructor_parameters
1816
- cascade_invocations
1917
- comment_references
20-
- directives_ordering
2118
- join_return_with_assignment
22-
- lines_longer_than_80_chars
2319
- missing_whitespace_between_adjacent_strings
2420
- no_adjacent_strings_in_list
2521
- no_runtimeType_toString
26-
- omit_local_variable_types
27-
- only_throw_errors
28-
- prefer_asserts_in_initializer_lists
2922
- prefer_const_constructors
3023
- prefer_const_declarations
3124
- prefer_expression_function_bodies
3225
- prefer_relative_imports
33-
- prefer_single_quotes
34-
- sort_pub_dependencies
3526
- test_types_in_equals
36-
- throw_in_finally
37-
- type_annotate_public_apis
38-
- unawaited_futures
39-
- unnecessary_lambdas
40-
- unnecessary_parenthesis
41-
- unnecessary_statements
42-
- use_is_even_rather_than_modulo
4327
- use_string_buffers
4428
- use_super_parameters

pkgs/cronet_http/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.1-dev
2+
3+
* Require Dart 2.19
4+
15
## 0.2.0
26

37
* Restructure `package:cronet_http` to offer a

pkgs/cronet_http/example/integration_test/cronet_configuration_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
/// Tests various [CronetEngine] configurations.
6+
library;
67

78
import 'dart:io';
89

pkgs/cronet_http/example/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Demonstrates how to use the cronet_http plugin.
44
publish_to: 'none'
55

66
environment:
7-
sdk: ">=2.17.5 <3.0.0"
7+
sdk: ">=2.19.0 <3.0.0"
88

99
dependencies:
1010
cached_network_image: ^3.2.3
@@ -16,13 +16,14 @@ dependencies:
1616
http: ^0.13.5
1717

1818
dev_dependencies:
19-
flutter_lints: ^1.0.0
19+
dart_flutter_team_lints: ^1.0.0
2020
flutter_test:
2121
sdk: flutter
2222
http_client_conformance_tests:
2323
path: ../../http_client_conformance_tests/
2424
integration_test:
2525
sdk: flutter
26+
test: ^1.23.1
2627

2728
flutter:
2829
uses-material-design: true

pkgs/cronet_http/lib/cronet_http.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
/// After the above setup, calling [Client] methods or any of the
5151
/// `package:http` convenient functions (e.g. [get]) will result in
5252
/// [CronetClient] being used on Android.
53+
library;
5354

5455
import 'package:http/http.dart';
5556

pkgs/cronet_http/lib/src/cronet_client.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/// [`WidgetsFlutterBinding.ensureInitialized`](https://api.flutter.dev/flutter/widgets/WidgetsFlutterBinding/ensureInitialized.html)
1212
/// or
1313
/// [`runApp`](https://api.flutter.dev/flutter/widgets/runApp.html).
14+
library;
1415

1516
import 'dart:async';
1617

@@ -19,7 +20,7 @@ import 'package:http/http.dart';
1920

2021
import 'messages.dart' as messages;
2122

22-
late final _api = messages.HttpApi();
23+
final _api = messages.HttpApi();
2324

2425
final Finalizer<String> _cronetEngineFinalizer = Finalizer(_api.freeEngine);
2526

pkgs/cronet_http/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: cronet_http
22
description: >
33
An Android Flutter plugin that provides access to the Cronet HTTP client.
4-
version: 0.2.0
4+
version: 0.2.1-dev
55
repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http
66

77
environment:
8-
sdk: ">=2.17.5 <3.0.0"
8+
sdk: ">=2.19.0 <3.0.0"
99
flutter: ">=3.0.0"
1010

1111
dependencies:
@@ -14,7 +14,7 @@ dependencies:
1414
http: ^0.13.4
1515

1616
dev_dependencies:
17-
lints: ^1.0.0
17+
dart_flutter_team_lints: ^1.0.0
1818
pigeon: ^3.2.3
1919
xml: ^6.1.0
2020
yaml_edit: ^2.0.3

pkgs/cronet_http/tool/prepare_for_embedded.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/// can be run to update package:cronet_http_embedded.
1919
///
2020
/// NOTE: This script modifies the above files in place.
21+
library;
2122

2223
import 'dart:io';
2324

pkgs/cupertino_http/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.2-dev
2+
3+
4+
15
## 0.1.1
26

37
* Add a `URLSession.sessionDescription` field.

pkgs/cupertino_http/example/integration_test/error_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@Skip('Error tests cannot currently be written. See comments in this file.')
6+
library;
67

78
import 'package:integration_test/integration_test.dart';
89
import 'package:test/test.dart';

pkgs/cupertino_http/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish_to: 'none'
66
version: 1.0.0+1
77

88
environment:
9-
sdk: ">=2.17.3 <3.0.0"
9+
sdk: ">=2.19.0 <3.0.0"
1010

1111
dependencies:
1212
cached_network_image: ^3.2.3
@@ -18,7 +18,7 @@ dependencies:
1818
http: ^0.13.5
1919

2020
dev_dependencies:
21-
flutter_lints: ^2.0.0
21+
dart_flutter_team_lints: ^1.0.0
2222
flutter_test:
2323
sdk: flutter
2424
http_client_conformance_tests:

pkgs/cupertino_http/lib/cupertino_http.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
/// task.resume();
7575
/// }
7676
/// ```
77+
library;
78+
7779
import 'package:http/http.dart';
7880

7981
import 'src/cupertino_client.dart';

pkgs/cupertino_http/lib/src/cupertino_api.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/// task.resume();
2525
/// }
2626
/// ```
27+
library;
2728

2829
import 'dart:ffi';
2930
import 'dart:isolate';
@@ -114,7 +115,7 @@ enum URLRequestNetworkService {
114115
///
115116
/// See [NSError](https://developer.apple.com/documentation/foundation/nserror)
116117
class Error extends _ObjectHolder<ncb.NSError> {
117-
Error._(ncb.NSError c) : super(c);
118+
Error._(super.c);
118119

119120
/// The numeric code for the error e.g. -1003 (kCFURLErrorCannotFindHost).
120121
///
@@ -161,7 +162,7 @@ class Error extends _ObjectHolder<ncb.NSError> {
161162
/// See [NSURLSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration)
162163
class URLSessionConfiguration
163164
extends _ObjectHolder<ncb.NSURLSessionConfiguration> {
164-
URLSessionConfiguration._(ncb.NSURLSessionConfiguration c) : super(c);
165+
URLSessionConfiguration._(super.c);
165166

166167
/// A configuration suitable for performing HTTP uploads and downloads in
167168
/// the background.
@@ -331,7 +332,7 @@ class URLSessionConfiguration
331332
///
332333
/// See [NSData](https://developer.apple.com/documentation/foundation/nsdata)
333334
class Data extends _ObjectHolder<ncb.NSData> {
334-
Data._(ncb.NSData c) : super(c);
335+
Data._(super.c);
335336

336337
// A new [Data] from an existing one.
337338
//
@@ -388,9 +389,9 @@ class Data extends _ObjectHolder<ncb.NSData> {
388389
class MutableData extends Data {
389390
final ncb.NSMutableData _mutableData;
390391

391-
MutableData._(ncb.NSMutableData c)
392+
MutableData._(ncb.NSMutableData super.c)
392393
: _mutableData = c,
393-
super._(c);
394+
super._();
394395

395396
/// A new empty [MutableData].
396397
factory MutableData.empty() =>
@@ -423,7 +424,7 @@ class MutableData extends Data {
423424
///
424425
/// See [NSURLResponse](https://developer.apple.com/documentation/foundation/nsurlresponse)
425426
class URLResponse extends _ObjectHolder<ncb.NSURLResponse> {
426-
URLResponse._(ncb.NSURLResponse c) : super(c);
427+
URLResponse._(super.c);
427428

428429
factory URLResponse._exactURLResponseType(ncb.NSURLResponse response) {
429430
if (ncb.NSHTTPURLResponse.isInstance(response)) {
@@ -455,9 +456,9 @@ class URLResponse extends _ObjectHolder<ncb.NSURLResponse> {
455456
class HTTPURLResponse extends URLResponse {
456457
final ncb.NSHTTPURLResponse _httpUrlResponse;
457458

458-
HTTPURLResponse._(ncb.NSHTTPURLResponse c)
459+
HTTPURLResponse._(ncb.NSHTTPURLResponse super.c)
459460
: _httpUrlResponse = c,
460-
super._(c);
461+
super._();
461462

462463
/// The HTTP status code of the response (e.g. 200).
463464
///
@@ -495,7 +496,7 @@ enum URLSessionTaskState {
495496
///
496497
/// See [NSURLSessionTask](https://developer.apple.com/documentation/foundation/nsurlsessiontask)
497498
class URLSessionTask extends _ObjectHolder<ncb.NSURLSessionTask> {
498-
URLSessionTask._(ncb.NSURLSessionTask c) : super(c);
499+
URLSessionTask._(super.c);
499500

500501
/// Cancels the task.
501502
///
@@ -657,7 +658,7 @@ class URLSessionTask extends _ObjectHolder<ncb.NSURLSessionTask> {
657658
///
658659
/// See [NSURLSessionDownloadTask](https://developer.apple.com/documentation/foundation/nsurlsessiondownloadtask)
659660
class URLSessionDownloadTask extends URLSessionTask {
660-
URLSessionDownloadTask._(ncb.NSURLSessionDownloadTask c) : super._(c);
661+
URLSessionDownloadTask._(ncb.NSURLSessionDownloadTask super.c) : super._();
661662

662663
@override
663664
String toString() => _toStringHelper('URLSessionDownloadTask');
@@ -667,7 +668,7 @@ class URLSessionDownloadTask extends URLSessionTask {
667668
///
668669
/// See [NSURLRequest](https://developer.apple.com/documentation/foundation/nsurlrequest)
669670
class URLRequest extends _ObjectHolder<ncb.NSURLRequest> {
670-
URLRequest._(ncb.NSURLRequest c) : super(c);
671+
URLRequest._(super.c);
671672

672673
/// Creates a request for a URL.
673674
///
@@ -751,9 +752,9 @@ class URLRequest extends _ObjectHolder<ncb.NSURLRequest> {
751752
class MutableURLRequest extends URLRequest {
752753
final ncb.NSMutableURLRequest _mutableUrlRequest;
753754

754-
MutableURLRequest._(ncb.NSMutableURLRequest c)
755+
MutableURLRequest._(ncb.NSMutableURLRequest super.c)
755756
: _mutableUrlRequest = c,
756-
super._(c);
757+
super._();
757758

758759
/// Creates a request for a URL.
759760
///
@@ -978,7 +979,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
978979
void Function(URLSession session, URLSessionDownloadTask task, Uri uri)?
979980
_onFinishedDownloading;
980981

981-
URLSession._(ncb.NSURLSession c,
982+
URLSession._(super.c,
982983
{URLRequest? Function(URLSession session, URLSessionTask task,
983984
HTTPURLResponse response, URLRequest newRequest)?
984985
onRedirect,
@@ -995,8 +996,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
995996
_onResponse = onResponse,
996997
_onData = onData,
997998
_onFinishedDownloading = onFinishedDownloading,
998-
_onComplete = onComplete,
999-
super(c);
999+
_onComplete = onComplete;
10001000

10011001
/// A client with reasonable default behavior.
10021002
///

0 commit comments

Comments
 (0)