Skip to content

Commit

Permalink
Move to pkg:dart_flutter_team_lints, require Dart 2.19 (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Mar 2, 2023
1 parent 35b2cef commit 5a2f036
Show file tree
Hide file tree
Showing 43 changed files with 139 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cronet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: Install dependencies
run: flutter pub get
- name: Check formatting
run: flutter format --output=none --set-exit-if-changed .
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: flutter analyze --fatal-infos
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lints/recommended.yaml
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
Expand All @@ -9,36 +9,20 @@ analyzer:
linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_dynamic_calls
- avoid_private_typedef_functions
- avoid_returning_this
- avoid_unused_constructor_parameters
- cascade_invocations
- comment_references
- directives_ordering
- join_return_with_assignment
- lines_longer_than_80_chars
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- omit_local_variable_types
- only_throw_errors
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_relative_imports
- prefer_single_quotes
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- type_annotate_public_apis
- unawaited_futures
- unnecessary_lambdas
- unnecessary_parenthesis
- unnecessary_statements
- use_is_even_rather_than_modulo
- use_string_buffers
- use_super_parameters
4 changes: 4 additions & 0 deletions pkgs/cronet_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.1-dev

* Require Dart 2.19

## 0.2.0

* Restructure `package:cronet_http` to offer a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

/// Tests various [CronetEngine] configurations.
library;

import 'dart:io';

Expand Down
5 changes: 3 additions & 2 deletions pkgs/cronet_http/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Demonstrates how to use the cronet_http plugin.
publish_to: 'none'

environment:
sdk: ">=2.17.5 <3.0.0"
sdk: ">=2.19.0 <3.0.0"

dependencies:
cached_network_image: ^3.2.3
Expand All @@ -16,13 +16,14 @@ dependencies:
http: ^0.13.5

dev_dependencies:
flutter_lints: ^1.0.0
dart_flutter_team_lints: ^1.0.0
flutter_test:
sdk: flutter
http_client_conformance_tests:
path: ../../http_client_conformance_tests/
integration_test:
sdk: flutter
test: ^1.23.1

flutter:
uses-material-design: true
1 change: 1 addition & 0 deletions pkgs/cronet_http/lib/cronet_http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
/// After the above setup, calling [Client] methods or any of the
/// `package:http` convenient functions (e.g. [get]) will result in
/// [CronetClient] being used on Android.
library;

import 'package:http/http.dart';

Expand Down
3 changes: 2 additions & 1 deletion pkgs/cronet_http/lib/src/cronet_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/// [`WidgetsFlutterBinding.ensureInitialized`](https://api.flutter.dev/flutter/widgets/WidgetsFlutterBinding/ensureInitialized.html)
/// or
/// [`runApp`](https://api.flutter.dev/flutter/widgets/runApp.html).
library;

import 'dart:async';

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

import 'messages.dart' as messages;

late final _api = messages.HttpApi();
final _api = messages.HttpApi();

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

Expand Down
24 changes: 8 additions & 16 deletions pkgs/cronet_http/lib/src/messages.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkgs/cronet_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: cronet_http
description: >
An Android Flutter plugin that provides access to the Cronet HTTP client.
version: 0.2.0
version: 0.2.1-dev
repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http

environment:
sdk: ">=2.17.5 <3.0.0"
sdk: ">=2.19.0 <3.0.0"
flutter: ">=3.0.0"

dependencies:
Expand All @@ -14,7 +14,7 @@ dependencies:
http: ^0.13.4

dev_dependencies:
lints: ^1.0.0
dart_flutter_team_lints: ^1.0.0
pigeon: ^3.2.3
xml: ^6.1.0
yaml_edit: ^2.0.3
Expand Down
1 change: 1 addition & 0 deletions pkgs/cronet_http/tool/prepare_for_embedded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/// can be run to update package:cronet_http_embedded.
///
/// NOTE: This script modifies the above files in place.
library;

import 'dart:io';

Expand Down
4 changes: 4 additions & 0 deletions pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.2-dev

* Require Dart 2.19

## 0.1.1

* Add a `URLSession.sessionDescription` field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

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

import 'package:integration_test/integration_test.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 2 additions & 2 deletions pkgs/cupertino_http/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: ">=2.17.3 <3.0.0"
sdk: ">=2.19.0 <3.0.0"

dependencies:
cached_network_image: ^3.2.3
Expand All @@ -18,7 +18,7 @@ dependencies:
http: ^0.13.5

dev_dependencies:
flutter_lints: ^2.0.0
dart_flutter_team_lints: ^1.0.0
flutter_test:
sdk: flutter
http_client_conformance_tests:
Expand Down
2 changes: 2 additions & 0 deletions pkgs/cupertino_http/lib/cupertino_http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
/// task.resume();
/// }
/// ```
library;

import 'package:http/http.dart';

import 'src/cupertino_client.dart';
Expand Down
Loading

0 comments on commit 5a2f036

Please sign in to comment.