blackbird 0.0.3
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 #
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.
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
Testobjects according to your domain. - Readable: The API is designed to be readable and expressive.
Installation #
dart pub add blackbird