# dylib 0.3.2

A set of helpers that help resolving names and paths of dynamic libraries.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'dylib:0.3.2'
```
Published: 2021-03-19T20:42:25.736024Z
Expected archive SHA-256: ad7de95923507c27df6a0b687905a22748f5676962a587b5c449fe575f87e294

Available in cache; verification: upstream_checksum
## Direct dependencies
- meta: ^1.3.0
- path: ^1.8.0
- platform: ^3.0.0

## Package README (untrusted upstream documentation)
# dylib

[![pub](https://img.shields.io/pub/v/dylib.svg)](https://pub.dev/packages/dylib)
[![license: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![build](https://github.com/jpnurmi/dylib.dart/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/jpnurmi/dylib.dart/branch/master/graph/badge.svg)](https://codecov.io/gh/jpnurmi/dylib.dart)

A set of helpers that help resolving 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:

```dart
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.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.







 
