From e2565877958ccdd5b46c8654daa49db17b19ea55 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 2 Oct 2024 14:16:32 -0700 Subject: [PATCH] Remove --- .../example/android/local.properties | 2 - pkgs/cupertino_http/lib/src/simple.dart | 54 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 pkgs/cupertino_http/example/android/local.properties delete mode 100644 pkgs/cupertino_http/lib/src/simple.dart diff --git a/pkgs/cupertino_http/example/android/local.properties b/pkgs/cupertino_http/example/android/local.properties deleted file mode 100644 index f2e984abc4..0000000000 --- a/pkgs/cupertino_http/example/android/local.properties +++ /dev/null @@ -1,2 +0,0 @@ -sdk.dir=/Users/bquinlan/Library/Android/sdk -flutter.sdk=/Users/bquinlan/flutter \ No newline at end of file diff --git a/pkgs/cupertino_http/lib/src/simple.dart b/pkgs/cupertino_http/lib/src/simple.dart deleted file mode 100644 index 6e72653a33..0000000000 --- a/pkgs/cupertino_http/lib/src/simple.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'dart:async'; -import 'dart:ffi'; -import 'dart:isolate'; - -import 'package:async/async.dart'; -import 'package:objective_c/objective_c.dart' as objc; - -import 'native_cupertino_bindings.dart' as ncb; - -void doHTTPRequest() { - final queue = ncb.NSOperationQueue.new1() - ..maxConcurrentOperationCount = 1 - ..name = 'cupertino_http.NSURLSessionDelegateQueue'.toNSString(); - - final protoBuilder = objc.ObjCProtocolBuilder(); - - ncb.NSURLSessionDataDelegate.addToBuilderAsListener( - protoBuilder, - URLSession_dataTask_didReceiveResponse_completionHandler_: - (session, dataTask, response, completionHandler) { - final httpResponse = ncb.NSHTTPURLResponse.castFrom(response); - - print( - 'Got a response ${httpResponse.MIMEType.toString()} ${httpResponse.statusCode}, ${httpResponse.expectedContentLength}'); - completionHandler - .call(ncb.NSURLSessionResponseDisposition.NSURLSessionResponseAllow); - }, - URLSession_dataTask_didReceiveData_: (session, dataTask, data) { - print('Do something with the data: ${data.length}'); - }, - /* - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_: - (nsSession, nsTask, nsResponse, nsRequest, nsRequestCompleter) { - print('redirect'); - nsRequestCompleter.call; - }, - */ - ); - - ncb.NSURLSessionDownloadDelegate.addToBuilderAsListener(protoBuilder, - URLSession_downloadTask_didFinishDownloadingToURL_: (session, task, url) { - print('Do something.'); - }); - final delegate = protoBuilder.build(); - - final session = - ncb.NSURLSession.sessionWithConfiguration_delegate_delegateQueue_( - ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration(), - delegate, - queue); - session.dataTaskWithURL_( - objc.NSURL.URLWithString_('https://www.google.com/'.toNSString())!) - ..resume(); -}