cupertino_ffi_generated 0.1.1

Pub Package Build Status

Overview #

This package enables Dart developers to use a large number Objective-C APIs. The bindings are generated with cupertino_ffi.

Most Flutter developers should not use this package. It's almost always a better idea to write a Flutter plugin than use this package. Flutter plugins are less likely to contain memory management bugs, they are automatically isolated from the UI event loop, they support all APIs, and the development experience is just a lot better.

The advantages of this package are automatic generation of APIs (no need to write message passing code) and support for non-Flutter applications such as command-line tools.

If you decide to use this package, you must follow the correct reference counting patterns documented by cupertino_ffi.

Contributing #

Status #

  • [X] Generator scripts
  • [ ] Generated source code passes manual tests
  • [ ] Helpers for implementing Objective-C protocols

Toll-free bridged types #

Note that Foundation types (NSString, etc.) and Core Foundation types (CFString, etc.) are "toll-free" bridged types. This means that Pointer<CFString> can be used as Pointer<NSString> and vice-versa.

Core Foundation dart:ffi bindings can be found in cupertino_ffi.

Generated libraries #

Dartdoc can be found here.

NameImportDescription
CloudKit (docs)"package:cupertino_ffi/cloudkit.dart"Cloud-based storage.
Contacts (docs)"package:cupertino_ffi/contacts.dart"Contacts.
Core Data (docs)"package:cupertino_ffi/core_data.dart"Loading and storing data.
Core Graphics (docs)"package:cupertino_ffi/core_graphics.dart"Images.
Core Location (docs)"package:cupertino_ffi/core_location.dart"Geographical location.
Core ML (docs)"package:cupertino_ffi/core_ml.dart"Machine learning.
Core Spotlight (docs)"package:cupertino_ffi/core_spotlight.dart"Search.
Core WLAN (docs)"package:cupertino_ffi/core_wlan.dart"WLAN.
EventKit (docs)"package:cupertino_ffi/eventkit.dart"Calendar events.
Foundation (docs)"package:cupertino_ffi/foundation.dart"Essential APIs.
HomeKit (docs)"package:cupertino_ffi/homekit.dart"Home automation.
Multipeer Connectivity (docs)"package:cupertino_ffi/multipeer_connectivity.dart"Peer-to-peer connectivity.
ModelIO (docs)"package:cupertino_ffi/modelio.dart"3D model assets.
Natural Language (docs)"package:cupertino_ffi/natural_language.dart"Natural language processing (NLP).
Objective-C runtime (docs)"package:cupertino_ffi/objective_c.dart"Objective-C internals.
PassKit (docs)"package:cupertino_ffi/passkit.dart"Apple Pay and Apple Wallet.
PreferencePanes (docs)"package:cupertino_ffi/preferencepanes.dart"System preferences.
SceneKit (docs)"package:cupertino_ffi/scenekit.dart"3D rendering.
Security (docs)"package:cupertino_ffi/security.dart"Keychain, cryptography, authentication.
Speech (docs)"package:cupertino_ffi/speech.dart"Speech recognition.
Social (docs)"package:cupertino_ffi/social.dart"Social media.
StoreKit (docs)"package:cupertino_ffi/storekit.dart"App Store.
Vision (docs)"package:cupertino_ffi/vision.dart"Computer vision.
WebKit (docs)"package:cupertino_ffi/webkit.dart"Browser engine.

Want to add a library? Create an issue!

0.1.1 #

  • Travis CI

0.1.0 #

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  cupertino_ffi_generated: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:cupertino_ffi_generated/cloudkit.dart';
import 'package:cupertino_ffi_generated/contacts.dart';
import 'package:cupertino_ffi_generated/core_data.dart';
import 'package:cupertino_ffi_generated/core_location.dart';
import 'package:cupertino_ffi_generated/core_ml.dart';
import 'package:cupertino_ffi_generated/core_spotlight.dart';
import 'package:cupertino_ffi_generated/core_wlan.dart';
import 'package:cupertino_ffi_generated/eventkit.dart';
import 'package:cupertino_ffi_generated/foundation.dart';
import 'package:cupertino_ffi_generated/homekit.dart';
import 'package:cupertino_ffi_generated/modelio.dart';
import 'package:cupertino_ffi_generated/natural_language.dart';
import 'package:cupertino_ffi_generated/passkit.dart';
import 'package:cupertino_ffi_generated/preferencepanes.dart';
import 'package:cupertino_ffi_generated/safari_services.dart';
import 'package:cupertino_ffi_generated/scenekit.dart';
import 'package:cupertino_ffi_generated/social.dart';
import 'package:cupertino_ffi_generated/speech.dart';
import 'package:cupertino_ffi_generated/storekit.dart';
import 'package:cupertino_ffi_generated/vision.dart';
import 'package:cupertino_ffi_generated/webkit.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Feb 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and cupertino_ffi_generated.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
cupertino_ffi ^0.2.1 0.2.1
ffi ^0.1.3 0.1.3
meta ^1.1.0 1.1.8
Dev dependencies
pedantic ^1.8.0
test ^1.6.0