tree: 74d00e2511a7e7b34b1b3c7b51afdd25fda734e7 [path history] [tgz]
  1. hook/
  2. lib/
  3. src/
  4. test/
  5. ffigen.yaml
  6. pubspec.yaml
  7. README.md
pkgs/native_assets_cli/example/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:

  • 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.
  • build.dart implements the CLI that communicates which native assets to build/bundle with the Dart/Flutter SDK.