Skip to content

Commit

Permalink
Compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Jul 9, 2024
1 parent 9527dd4 commit 419de5a
Show file tree
Hide file tree
Showing 3 changed files with 2,806 additions and 2,036 deletions.
31 changes: 17 additions & 14 deletions pkgs/cupertino_http/lib/src/cupertino_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1093,20 +1093,23 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
objc.NSData? reason)? _onWebSocketTaskClosed;

static objc.ObjCObjectBase delegate() {
print('delegate()');
final protoBuilder = objc.ObjCProtocolBuilder()
..implementMethodAsListener(
ncb.NSURLSessionDataDelegate
.URLSession_dataTask_didReceiveResponse_completionHandler_,
(ncb.NSURLSession session,
ncb.NSURLSessionDataTask dataTask,
ncb.NSURLResponse response,
ncb.ObjCBlock_ffiVoid_NSURLSessionResponseDisposition
completetionHandler) {
print('response');
completetionHandler.call(
ncb.NSURLSessionResponseDisposition.NSURLSessionResponseAllow);
});
final protoBuilder = objc.ObjCProtocolBuilder();

ncb.NSURLSessionDataDelegate.addToBuilderAsListener(protoBuilder,
URLSession_dataTask_didReceiveResponse_completionHandler_:
(session, dataTask, response, completionHandler) {
print('Got a response.');
completionHandler
.call(ncb.NSURLSessionResponseDisposition.NSURLSessionResponseAllow);
}, URLSession_dataTask_didReceiveData_: (session, dataTask, data) {
print('Do something with the data.');
});

ncb.NSURLSessionDownloadDelegate.addToBuilderAsListener(protoBuilder,
URLSession_downloadTask_didFinishDownloadingToURL_:
(session, task, url) {
print('Do something.');
});
return protoBuilder.build();
}

Expand Down
Loading

0 comments on commit 419de5a

Please sign in to comment.