tree: 9aa664214015e90e5f95e5c52d55b54eda69c482 [path history] [tgz]
  1. hook/
  2. lib/
  3. src/
  4. test/
  5. ffigen.yaml
  6. pubspec.yaml
  7. README.md
pkgs/hooks/example/build/native_add_library/README.md

An example library containing native code that should be bundled with Dart and Flutter applications.

Usage

Run tests with dart --enable-experiment=native-assets test.

Code organization

A typical layout of a package with native code is:

  • hook/build.dart implements the CLI that communicates which native assets to build/bundle with the Dart/Flutter SDK.
  • lib/ contains Dart code which uses [dart:ffi] and [package:ffigen] to call into native code.
  • src/ contains C code which is built and then invoked through dart:ffi.