Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mainser/cindel/llms.txt

Use this file to discover all available pages before exploring further.

Cindel’s Dart API talks to a Rust native core through FFI on native platforms and through a Worker/Wasm runtime on Web. These runtime files must be present in the final app bundle for Cindel to work. The cindel_flutter_libs companion package ships prebuilt libraries and Web assets for every supported platform so that app developers do not need Rust, Cargo, or any native build toolchain to use Cindel in a Flutter app.
Most Flutter apps never need to think about native libraries directly. Adding cindel_flutter_libs as a dependency is the only step required — Flutter’s build system locates and bundles the correct library for each target platform automatically.

Adding the companion package

dependencies:
  cindel: ^0.9.1
  cindel_flutter_libs: ^0.9.1
No Dart import from cindel_flutter_libs is required. The cindel package owns the public API:
import 'package:cindel/cindel.dart';
cindel_flutter_libs is present so Flutter’s platform build can find and bundle the required native libraries or Web Worker/Wasm assets. Keep both packages on the same version line — they share a native ABI that must match.

Bundled libraries by platform

Android

Prebuilt .so libraries are included for three ABIs:
ABIFile
arm64-v8aandroid/src/main/jniLibs/arm64-v8a/libcindel_native.so
armeabi-v7aandroid/src/main/jniLibs/armeabi-v7a/libcindel_native.so
x86_64android/src/main/jniLibs/x86_64/libcindel_native.so

iOS

An xcframework is provided via the cindel_flutter_libs CocoaPods podspec. It is generated on macOS with Xcode before publishing Apple runtime support.

macOS

A universal (multi-architecture) library is included via the cindel_flutter_libs podspec.

Windows

windows/cindel_native.dll

Linux

linux/libcindel_native.so

Web

The Web runtime is SQLite/OPFS only — MDBX is not a browser backend:
FilePurpose
web/cindel_worker.jsWorker bootstrap
web/pkg/cindel_native.jsWasm JS glue
web/pkg/cindel_native_bg.wasmCompiled Rust + SQLite Wasm runtime
The bundled native libraries for Android, iOS, macOS, Windows, and Linux include both storage backends compiled in — MDBX (the default) and SQLite (selectable explicitly). On Web, only the SQLite backend is compiled into the Wasm runtime.

Pure Dart tools (non-Flutter)

For Dart command-line tools or test runners that use cindel but do not go through Flutter’s plugin system, set the CINDEL_NATIVE_LIBRARY environment variable to the absolute path of the native library before running:
# Windows PowerShell
$env:CINDEL_NATIVE_LIBRARY = 'D:\path\to\cindel_native.dll'
dart run my_tool.dart
# macOS / Linux
export CINDEL_NATIVE_LIBRARY=/path/to/libcindel_native.so
dart run my_tool.dart
The cindel package reads this variable at startup and loads the library from that path instead of searching default plugin locations.

Building from source

The tool/prebuilt/ directory in the Cindel repository contains the build scripts that compile the Rust native core and copy the outputs into packages/cindel_flutter_libs. Maintainer toolchain requirements vary by platform:
PlatformScriptRequirements
Windowsbuild_windows.ps1Rust MSVC toolchain, LLVM/libclang
Androidbuild_android.ps1Rust Android targets, Android NDK, LLVM/libclang
iOS / macOSbuild_apple.shmacOS, Xcode CLI tools, Rust Apple targets, LLVM/libclang
Linuxbuild_linux.shRust GNU toolchain, LLVM/libclang
Webbuild_web.ps1Rust wasm32-unknown-unknown, LLVM/clang, wasm-bindgen-cli
# Windows — run from the repository root
.\tool\prebuilt\build_windows.ps1
.\tool\prebuilt\build_android.ps1
.\tool\prebuilt\build_web.ps1
# macOS / Linux — run from the repository root
./tool/prebuilt/build_apple.sh
./tool/prebuilt/build_linux.sh
The Web script produces the SQLite-only Wasm runtime (--no-default-features --features web). The native platform scripts build with the mdbx Cargo feature enabled so both SQLite and MDBX are available to Flutter consumers without a local Rust toolchain.
Use the prebuilt libraries from the coordinated GitHub releases rather than building from source. The release workflow regenerates all platform binaries before each publish, and the prebuilts in cindel_flutter_libs are kept aligned with the native ABI expected by the Dart runtime for that release.

Build docs developers (and LLMs) love