blackbird 0.0.3 copy "blackbird: ^0.0.3" to clipboard
blackbird: ^0.0.3 copied to clipboard

A boolean logic library for Dart and Flutter, allowing you to build trees of conditions and evaluate them.

Blackbird #

pub package CI codecov

A boolean logic library for Dart and Flutter, allowing you to build trees of conditions and evaluate them.

Purpose #

While there is no limit to what you can/should do with blackbird, it's aimed at building flexible query UIs for your applications.

Example

Design #

Blackbird is designed to provide the building blocks for building condition trees (blackbird is named after Blackbird State Forest in Delaware, US.). Out of the box, it provides the Condition, NestedCondition, TestCondition, and Test classes. You can use these to build complex trees of conditions and evaluate them.

Example usage #

Check out the example for a simple example.

final condition = Or(
  [
    IsTrue(StartsWithLowerCase()),
    IsTrue(ContainsString('One')),
  ],
);

expect(condition.evaluate('hello'), isTrue);
expect(condition.evaluate('On'), isFalse);

Features #

  • Type-safe: The entire condition tree is typed to your type T.
  • Extensible: Define Test objects according to your domain.
  • Readable: The API is designed to be readable and expressive.

Installation #

dart pub add blackbird
0
likes
160
points
51
downloads

Publisher

unverified uploader

Weekly Downloads

A boolean logic library for Dart and Flutter, allowing you to build trees of conditions and evaluate them.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, equatable, uuid

More

Packages that depend on blackbird