Skip to content

Commit e4558df

Browse files
authored
chore(cupertino_http): Switch to objective_c 9.1.0 (#1850)
1 parent 35e8272 commit e4558df

File tree

6 files changed

+25556
-25391
lines changed

6 files changed

+25556
-25391
lines changed

pkgs/cupertino_http/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## 2.4.0-wip
1+
## 2.4.0
22

3-
* Switch to `package:objective_c` `8.1.0` and `package:ffigen` `19.1.0`.
3+
* Switch to `package:objective_c` `9.1.0` and `package:ffigen` `20.1.0`.
44
* Add URL to thrown `RequestAbortedException`.
55

66
## 2.3.0

pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m

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

pkgs/cupertino_http/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ dev_dependencies:
2323
convert: ^3.1.1
2424
crypto: ^3.0.3
2525
dart_flutter_team_lints: ^3.0.0
26-
ffi: ^2.0.1
26+
ffi: ^2.1.4
2727
flutter_test:
2828
sdk: flutter
2929
http_client_conformance_tests:
3030
path: ../../http_client_conformance_tests/
3131
http_profile: ^0.1.0
3232
integration_test:
3333
sdk: flutter
34-
objective_c: ^8.1.0
34+
objective_c: ^9.1.0
3535
test: ^1.21.1
3636
web_socket: '^1.0.0'
3737
web_socket_conformance_tests:

pkgs/cupertino_http/lib/src/cupertino_api.dart

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class URLCache extends _ObjectHolder<ncb.NSURLCache> {
101101
int diskCapacity = 0,
102102
Uri? directory,
103103
}) => URLCache._(
104-
ncb.NSURLCache.alloc().initWithMemoryCapacity$1(
104+
ncb.NSURLCache.alloc().initWithMemoryCapacity(
105105
memoryCapacity,
106106
diskCapacity: diskCapacity,
107107
directoryURL: directory == null ? null : _uriToNSURL(directory),
@@ -139,7 +139,7 @@ class URLSessionConfiguration
139139
/// See [NSURLSessionConfiguration defaultSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411560-defaultsessionconfiguration)
140140
factory URLSessionConfiguration.defaultSessionConfiguration() =>
141141
URLSessionConfiguration._(
142-
ncb.NSURLSessionConfiguration.castFrom(
142+
ncb.NSURLSessionConfiguration.as(
143143
ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration(),
144144
),
145145
isBackground: false,
@@ -151,7 +151,7 @@ class URLSessionConfiguration
151151
/// See [NSURLSessionConfiguration ephemeralSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1410529-ephemeralsessionconfiguration)
152152
factory URLSessionConfiguration.ephemeralSessionConfiguration() =>
153153
URLSessionConfiguration._(
154-
ncb.NSURLSessionConfiguration.castFrom(
154+
ncb.NSURLSessionConfiguration.as(
155155
ncb.NSURLSessionConfiguration.getEphemeralSessionConfiguration(),
156156
),
157157
isBackground: false,
@@ -192,8 +192,8 @@ class URLSessionConfiguration
192192
/// Whether background tasks can be delayed by the system.
193193
///
194194
/// See [NSURLSessionConfiguration.discretionary](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411552-discretionary)
195-
bool get discretionary => _nsObject.discretionary;
196-
set discretionary(bool value) => _nsObject.discretionary = value;
195+
bool get discretionary => _nsObject.isDiscretionary;
196+
set discretionary(bool value) => _nsObject.isDiscretionary = value;
197197

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

339339
factory URLResponse._exactURLResponseType(ncb.NSURLResponse response) {
340-
if (ncb.NSHTTPURLResponse.isInstance(response)) {
341-
return HTTPURLResponse._(ncb.NSHTTPURLResponse.castFrom(response));
340+
if (ncb.NSHTTPURLResponse.isA(response)) {
341+
return HTTPURLResponse._(ncb.NSHTTPURLResponse.as(response));
342342
}
343343
return URLResponse._(response);
344344
}
@@ -778,7 +778,7 @@ class MutableURLRequest extends URLRequest {
778778
}
779779

780780
set cachePolicy(NSURLRequestCachePolicy value) =>
781-
_mutableUrlRequest.cachePolicy = value;
781+
_mutableUrlRequest.cachePolicy$1 = value;
782782

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

798798
set timeoutInterval(Duration interval) {
799-
_mutableUrlRequest.timeoutInterval =
799+
_mutableUrlRequest.timeoutInterval$1 =
800800
interval.inMicroseconds.toDouble() / Duration.microsecondsPerSecond;
801801
}
802802

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

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

883883
if (onRedirect != null) {
884884
ncb
885-
.NSURLSessionDataDelegate
885+
.NSURLSessionDataDelegate$Builder
886886
// ignore: lines_longer_than_80_chars
887887
.URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_
888888
.implementAsListener(
@@ -907,7 +907,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
907907

908908
if (onResponse != null) {
909909
ncb
910-
.NSURLSessionDataDelegate
910+
.NSURLSessionDataDelegate$Builder
911911
.URLSession_dataTask_didReceiveResponse_completionHandler_
912912
.implementAsListener(protoBuilder, (
913913
nsSession,
@@ -926,7 +926,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
926926
}
927927

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

939939
if (onFinishedDownloading != null) {
940940
ncb
941-
.NSURLSessionDownloadDelegate
941+
.NSURLSessionDownloadDelegate$Builder
942942
.URLSession_downloadTask_didFinishDownloadingToURL_
943943
.implementAsBlocking(protoBuilder, (nsSession, nsTask, nsUrl) {
944944
onFinishedDownloading(
@@ -951,7 +951,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
951951

952952
if (onWebSocketTaskOpened != null) {
953953
ncb
954-
.NSURLSessionWebSocketDelegate
954+
.NSURLSessionWebSocketDelegate$Builder
955955
.URLSession_webSocketTask_didOpenWithProtocol_
956956
.implementAsListener(protoBuilder, (nsSession, nsTask, nsProtocol) {
957957
onWebSocketTaskOpened(
@@ -964,7 +964,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
964964

965965
if (onWebSocketTaskClosed != null) {
966966
ncb
967-
.NSURLSessionWebSocketDelegate
967+
.NSURLSessionWebSocketDelegate$Builder
968968
.URLSession_webSocketTask_didCloseWithCode_reason_
969969
.implementAsListener(protoBuilder, (
970970
nsSession,
@@ -981,7 +981,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
981981
});
982982
}
983983

984-
return ncb.NSURLSessionDelegate.castFrom(protoBuilder.build());
984+
return ncb.NSURLSessionDelegate.as(protoBuilder.build());
985985
}
986986

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

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

11661166
final task = ncb.NSURLSessionAsynchronousConvenience(
11671167
_nsObject,
1168-
).dataTaskWithRequest(request._nsObject, completionHandler: completer);
1168+
).dataTaskWithRequest$1(request._nsObject, completionHandler: completer);
11691169

11701170
return URLSessionTask._(task);
11711171
}

0 commit comments

Comments
 (0)