dylib
0.3.3A set of helpers for resolving names and paths of dynamic libraries.
Readme
dylib
pub license: MIT build codecov
A set of helpers for resolving file names and paths of dynamic libraries.
| Platform | Name |
|---|---|
| Android | libfoo.so |
| iOS | libfoo.dylib |
| Linux | libfoo.so |
| macOS | libfoo.dylib |
| Windows | foo.dll |
Usage
A simple usage example:
import 'package:dylib/dylib.dart';
import 'foo_bindings.dart'; // LibFoo generated by ffigen, for example
LibFoo get libfoo {
return _libfoo ??= LibFoo(ffi.DynamicLibrary.open(
resolveDylibPath(
'foo', // foo.dll vs. libfoo.so vs. libfoo.dylib
dartDefine: 'LIBFOO_PATH',
environmentVariable: 'LIBFOO_PATH',
),
));
}
void main() {
libfoo.bar();
}
Changelog
[0.3.3]
- Transferred to ubuntu-flutter-community.
- Updated example.
[0.3.2+1] - 2021-04-14
- A cosmetic description update.
[0.3.2] - 2021-03-19
- Add tests, CI, coverage, and example.
- Remove unused code to address pub.dev score.
[0.3.1] - 2021-03-09
- Allow specifying plain file name via environment.
[0.3.0] - 2021-03-08
- Upgrade to Dart SDK stable.
- Upgrade dependencies.
[0.2.1-nullsafety.0] - 2021-01-11
- Use environment variable as a fallback path.
[0.2.0-nullsafety.0] - 2021-01-10
- Allow specifying path, dart define & environment variables separately.
- Resolved missing dylib name prefix.
[0.1.0-nullsafety.1] - 2021-01-10
- Dot-prefixed dylib suffix to be compatible with path.setExtension().
[0.1.0-nullsafety.0] - 2021-01-09
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add dylibpubspec.yaml
name: dylib
description: A set of helpers for resolving names and paths of dynamic libraries.
version: 0.3.3
homepage: https://github.com/ubuntu-flutter-community/dylib.dart
repository: https://github.com/ubuntu-flutter-community/dylib.dart
issue_tracker: https://github.com/ubuntu-flutter-community/dylib.dart/issues
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
meta: ^1.3.0
path: ^1.8.0
platform: ^3.0.0
dev_dependencies:
lints: ^2.0.1
test: ^1.16.7
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.1.0-nullsafety.0 | Cached · Upstream SHA-256 matched | Download | 36273c73…c2cd4d |
| 0.1.0-nullsafety.1 | Cached · Upstream SHA-256 matched | Download | 04c4bd44…f80179 |
| 0.2.0-nullsafety.0 | Cached · Upstream SHA-256 matched | Download | 6733af7d…6c8ac2 |
| 0.2.1-nullsafety.0 | Cached · Upstream SHA-256 matched | Download | a2a04834…1ec8fb |
| 0.3.0 | Cached · Upstream SHA-256 matched | Download | bd2a7649…365029 |
| 0.3.1 | Cached · Upstream SHA-256 matched | Download | e443e964…9c6c2d |
| 0.3.2 | Cached · Upstream SHA-256 matched | Download | ad7de959…87e294 |
| 0.3.2+1 | Cached · Upstream SHA-256 matched | Download | 2421ffc8…4fdd0f |
| 0.3.3 | Cached · Upstream SHA-256 matched | Download | bf609b3e…760bb0 |
Dependencies
meta "^1.3.0"
path "^1.8.0"
platform "^3.0.0"