tree: fe2b60a7bfb58cc241e9ee311c527e81a4ee9cb7 [path history] [tgz]
  1. api/
  2. build/
  3. link/
  4. README.md
pkgs/hooks/example/README.md

Examples

The examples in package:hooks show how to use package:hooks and package:code_assets in build hooks to bundle native code with Dart and Flutter applications.

ExampleUse CaseUsed Features
host_nameGet the hostname.- Accessing a system library with DynamicLoadingSystem and LookupInProcess.
- OS-specific differences.
mini_audioPlay audio.- C library built from source with package:native_toolchain_c.
- Bundled with DynamicLoadingBundled.
sqliteDatabase access.- C library built from source with package:native_toolchain_c.
- Bundled with DynamicLoadingBundled.
sqlite_prebuiltDatabase access.- Pre-built binary downloaded from the internet or available on host machine.
- Bundled with DynamicLoadingBundled.
stb_imageRead image metadata.- C library built from source with package:native_toolchain_c.
- Bundled with DynamicLoadingBundled.

The following examples showcase individual features of of package:hooks:

  • build/ contains examples on how to use hook/build.dart to build and bundle code assets, such as C libraries, into Dart applications.
  • link/ contains examples on how to treeshake unused assets from a Dart application using the hook/link.dart script.