Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 2.4.0-wip
## 2.4.0

* Switch to `package:objective_c` `8.1.0` and `package:ffigen` `19.1.0`.
* Switch to `package:objective_c` `9.1.0` and `package:ffigen` `20.1.0`.
* Add URL to thrown `RequestAbortedException`.

## 2.3.0
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkgs/cupertino_http/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ dev_dependencies:
convert: ^3.1.1
crypto: ^3.0.3
dart_flutter_team_lints: ^3.0.0
ffi: ^2.0.1
ffi: ^2.1.4
flutter_test:
sdk: flutter
http_client_conformance_tests:
path: ../../http_client_conformance_tests/
http_profile: ^0.1.0
integration_test:
sdk: flutter
objective_c: ^8.1.0
objective_c: ^9.1.0
test: ^1.21.1
web_socket: '^1.0.0'
web_socket_conformance_tests:
Expand Down
40 changes: 20 additions & 20 deletions pkgs/cupertino_http/lib/src/cupertino_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class URLCache extends _ObjectHolder<ncb.NSURLCache> {
int diskCapacity = 0,
Uri? directory,
}) => URLCache._(
ncb.NSURLCache.alloc().initWithMemoryCapacity$1(
ncb.NSURLCache.alloc().initWithMemoryCapacity(
memoryCapacity,
diskCapacity: diskCapacity,
directoryURL: directory == null ? null : _uriToNSURL(directory),
Expand Down Expand Up @@ -139,7 +139,7 @@ class URLSessionConfiguration
/// See [NSURLSessionConfiguration defaultSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411560-defaultsessionconfiguration)
factory URLSessionConfiguration.defaultSessionConfiguration() =>
URLSessionConfiguration._(
ncb.NSURLSessionConfiguration.castFrom(
ncb.NSURLSessionConfiguration.as(
ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration(),
),
isBackground: false,
Expand All @@ -151,7 +151,7 @@ class URLSessionConfiguration
/// See [NSURLSessionConfiguration ephemeralSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1410529-ephemeralsessionconfiguration)
factory URLSessionConfiguration.ephemeralSessionConfiguration() =>
URLSessionConfiguration._(
ncb.NSURLSessionConfiguration.castFrom(
ncb.NSURLSessionConfiguration.as(
ncb.NSURLSessionConfiguration.getEphemeralSessionConfiguration(),
),
isBackground: false,
Expand Down Expand Up @@ -192,8 +192,8 @@ class URLSessionConfiguration
/// Whether background tasks can be delayed by the system.
///
/// See [NSURLSessionConfiguration.discretionary](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411552-discretionary)
bool get discretionary => _nsObject.discretionary;
set discretionary(bool value) => _nsObject.discretionary = value;
bool get discretionary => _nsObject.isDiscretionary;
set discretionary(bool value) => _nsObject.isDiscretionary = value;

/// Additional headers to send with each request.
///
Expand All @@ -202,7 +202,7 @@ class URLSessionConfiguration
/// See [NSURLSessionConfiguration.HTTPAdditionalHeaders](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411532-httpadditionalheaders)
Map<String, String>? get httpAdditionalHeaders {
if (_nsObject.HTTPAdditionalHeaders case var additionalHeaders?) {
final headers = objc.NSDictionary.castFrom(additionalHeaders);
final headers = objc.NSDictionary.as(additionalHeaders);
return (objc.toDartObject(headers) as Map).cast<String, String>();
}
return null;
Expand Down Expand Up @@ -337,8 +337,8 @@ class URLResponse extends _ObjectHolder<ncb.NSURLResponse> {
URLResponse._(super.c);

factory URLResponse._exactURLResponseType(ncb.NSURLResponse response) {
if (ncb.NSHTTPURLResponse.isInstance(response)) {
return HTTPURLResponse._(ncb.NSHTTPURLResponse.castFrom(response));
if (ncb.NSHTTPURLResponse.isA(response)) {
return HTTPURLResponse._(ncb.NSHTTPURLResponse.as(response));
}
return URLResponse._(response);
}
Expand Down Expand Up @@ -778,7 +778,7 @@ class MutableURLRequest extends URLRequest {
}

set cachePolicy(NSURLRequestCachePolicy value) =>
_mutableUrlRequest.cachePolicy = value;
_mutableUrlRequest.cachePolicy$1 = value;

set httpBody(objc.NSData? data) {
_mutableUrlRequest.HTTPBody = data;
Expand All @@ -796,7 +796,7 @@ class MutableURLRequest extends URLRequest {
}

set timeoutInterval(Duration interval) {
_mutableUrlRequest.timeoutInterval =
_mutableUrlRequest.timeoutInterval$1 =
interval.inMicroseconds.toDouble() / Duration.microsecondsPerSecond;
}

Expand Down Expand Up @@ -870,7 +870,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
final protoBuilder = objc.ObjCProtocolBuilder();

if (onComplete != null) {
ncb.NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_
ncb.NSURLSessionDataDelegate$Builder.URLSession_task_didCompleteWithError_
.implementAsListener(protoBuilder, (nsSession, nsTask, nsError) {
onComplete(
URLSession._(nsSession, isBackground: isBackground),
Expand All @@ -882,7 +882,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

if (onRedirect != null) {
ncb
.NSURLSessionDataDelegate
.NSURLSessionDataDelegate$Builder
// ignore: lines_longer_than_80_chars
.URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_
.implementAsListener(
Expand All @@ -907,7 +907,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

if (onResponse != null) {
ncb
.NSURLSessionDataDelegate
.NSURLSessionDataDelegate$Builder
.URLSession_dataTask_didReceiveResponse_completionHandler_
.implementAsListener(protoBuilder, (
nsSession,
Expand All @@ -926,7 +926,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
}

if (onData != null) {
ncb.NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_
ncb.NSURLSessionDataDelegate$Builder.URLSession_dataTask_didReceiveData_
.implementAsListener(protoBuilder, (nsSession, nsDataTask, nsData) {
onData(
URLSession._(nsSession, isBackground: isBackground),
Expand All @@ -938,7 +938,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

if (onFinishedDownloading != null) {
ncb
.NSURLSessionDownloadDelegate
.NSURLSessionDownloadDelegate$Builder
.URLSession_downloadTask_didFinishDownloadingToURL_
.implementAsBlocking(protoBuilder, (nsSession, nsTask, nsUrl) {
onFinishedDownloading(
Expand All @@ -951,7 +951,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

if (onWebSocketTaskOpened != null) {
ncb
.NSURLSessionWebSocketDelegate
.NSURLSessionWebSocketDelegate$Builder
.URLSession_webSocketTask_didOpenWithProtocol_
.implementAsListener(protoBuilder, (nsSession, nsTask, nsProtocol) {
onWebSocketTaskOpened(
Expand All @@ -964,7 +964,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

if (onWebSocketTaskClosed != null) {
ncb
.NSURLSessionWebSocketDelegate
.NSURLSessionWebSocketDelegate$Builder
.URLSession_webSocketTask_didCloseWithCode_reason_
.implementAsListener(protoBuilder, (
nsSession,
Expand All @@ -981,7 +981,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
});
}

return ncb.NSURLSessionDelegate.castFrom(protoBuilder.build());
return ncb.NSURLSessionDelegate.as(protoBuilder.build());
}

URLSession._(super.c, {required bool isBackground})
Expand Down Expand Up @@ -1115,7 +1115,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
///
/// See [NSURLSession.configuration](https://developer.apple.com/documentation/foundation/nsurlsession/1411477-configuration)
URLSessionConfiguration get configuration => URLSessionConfiguration._(
ncb.NSURLSessionConfiguration.castFrom(_nsObject.configuration),
ncb.NSURLSessionConfiguration.as(_nsObject.configuration),
isBackground: _isBackground,
);

Expand Down Expand Up @@ -1165,7 +1165,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {

final task = ncb.NSURLSessionAsynchronousConvenience(
_nsObject,
).dataTaskWithRequest(request._nsObject, completionHandler: completer);
).dataTaskWithRequest$1(request._nsObject, completionHandler: completer);

return URLSessionTask._(task);
}
Expand Down
Loading
Loading