tree: 01d1870bb2e4b71aec21e3da4711cfd9caa4fd4b [path history] [tgz]
  1. lib/
  2. src/
  3. test/
  4. build.dart
  5. ffigen.yaml
  6. pubspec.yaml
  7. pubspec_overrides.yaml
  8. 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.