Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkgs/cupertino_http/lib/src/utils.dart

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
32 changes: 16 additions & 16 deletions pkgs/cupertino_http/lib/src/cupertino_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/// task.resume();
/// }
/// ```
library;

import 'dart:ffi';
import 'dart:isolate';
Expand Down Expand Up @@ -114,7 +115,7 @@ enum URLRequestNetworkService {
///
/// See [NSError](https://developer.apple.com/documentation/foundation/nserror)
class Error extends _ObjectHolder<ncb.NSError> {
Error._(ncb.NSError c) : super(c);
Error._(super.c);

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

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

// A new [Data] from an existing one.
//
Expand Down Expand Up @@ -388,9 +389,9 @@ class Data extends _ObjectHolder<ncb.NSData> {
class MutableData extends Data {
final ncb.NSMutableData _mutableData;

MutableData._(ncb.NSMutableData c)
MutableData._(ncb.NSMutableData super.c)
: _mutableData = c,
super._(c);
super._();

/// A new empty [MutableData].
factory MutableData.empty() =>
Expand Down Expand Up @@ -423,7 +424,7 @@ class MutableData extends Data {
///
/// See [NSURLResponse](https://developer.apple.com/documentation/foundation/nsurlresponse)
class URLResponse extends _ObjectHolder<ncb.NSURLResponse> {
URLResponse._(ncb.NSURLResponse c) : super(c);
URLResponse._(super.c);

factory URLResponse._exactURLResponseType(ncb.NSURLResponse response) {
if (ncb.NSHTTPURLResponse.isInstance(response)) {
Expand Down Expand Up @@ -455,9 +456,9 @@ class URLResponse extends _ObjectHolder<ncb.NSURLResponse> {
class HTTPURLResponse extends URLResponse {
final ncb.NSHTTPURLResponse _httpUrlResponse;

HTTPURLResponse._(ncb.NSHTTPURLResponse c)
HTTPURLResponse._(ncb.NSHTTPURLResponse super.c)
: _httpUrlResponse = c,
super._(c);
super._();

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

/// Cancels the task.
///
Expand Down Expand Up @@ -657,7 +658,7 @@ class URLSessionTask extends _ObjectHolder<ncb.NSURLSessionTask> {
///
/// See [NSURLSessionDownloadTask](https://developer.apple.com/documentation/foundation/nsurlsessiondownloadtask)
class URLSessionDownloadTask extends URLSessionTask {
URLSessionDownloadTask._(ncb.NSURLSessionDownloadTask c) : super._(c);
URLSessionDownloadTask._(ncb.NSURLSessionDownloadTask super.c) : super._();

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

/// Creates a request for a URL.
///
Expand Down Expand Up @@ -751,9 +752,9 @@ class URLRequest extends _ObjectHolder<ncb.NSURLRequest> {
class MutableURLRequest extends URLRequest {
final ncb.NSMutableURLRequest _mutableUrlRequest;

MutableURLRequest._(ncb.NSMutableURLRequest c)
MutableURLRequest._(ncb.NSMutableURLRequest super.c)
: _mutableUrlRequest = c,
super._(c);
super._();

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

URLSession._(ncb.NSURLSession c,
URLSession._(super.c,
{URLRequest? Function(URLSession session, URLSessionTask task,
HTTPURLResponse response, URLRequest newRequest)?
onRedirect,
Expand All @@ -995,8 +996,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
_onResponse = onResponse,
_onData = onData,
_onFinishedDownloading = onFinishedDownloading,
_onComplete = onComplete,
super(c);
_onComplete = onComplete;

/// A client with reasonable default behavior.
///
Expand Down
1 change: 1 addition & 0 deletions pkgs/cupertino_http/lib/src/cupertino_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/// A [Client] implementation based on the
/// [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system).
library;

import 'dart:async';
import 'dart:io';
Expand Down
Loading