dylib
0.3.3, released 4 years ago by an unverified publisher
Resolves file names and paths of dynamic libraries across platforms.
What it does
Provides helpers to resolve the correct file names and paths for dynamic libraries on Android, iOS, Linux, macOS, and Windows. It integrates with dart-define and environment variables to allow custom library paths.
AI-written summary of version 0.3.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using dart:ffi to load dynamic libraries across multiple platforms
- You need to handle platform-specific library naming conventions (.so, .dylib, .dll)
Skip it when
- Your application does not use native C/C++ interop via dart:ffi
Strengths
- Simplifies cross-platform native library loading
- Supports custom paths via environment variables and dart-defines
Weaknesses
- Very narrow scope
- Not documented for complex custom bundling strategies
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:dylib/dylib.dart';
final path = resolveDylibPath(
'foo',
dartDefine: 'LIBFOO_PATH',
environmentVariable: 'LIBFOO_PATH',
);Works with
Packages commonly used together with dylib: ones it builds on, ones built on it, and its own family.
- platformdylib depends on itCross‑platform abstraction for querying runtime platform info in Dart.
- flutter_angleBuilt on dylibFlutters Almost Native Graphics Layer Engine is made by google to use OpenGL ES API calls to one of the hardware-supported APIs available for that platform.
- libserialportBuilt on dylibDart FFI bindings to libserialport for accessing serial ports.