Clone this repo:
  1. 67b3452 allow the 2.12 prerelease sdks and prep for release (#29) by Jacob MacDonald · 4 days ago master 2.1.0-nullsafety.2
  2. daaf60b Prepare for the 2.11 dev SDKs (#28) by Nate Bosch · 5 weeks ago 2.1.0-nullsafet.1 2.1.0-nullsafety.1
  3. d83eb6f Fix insecure URL in readme (#27) by Kevin Moore · 3 months ago 2.1.0-nullsafety
  4. 0834ba5 CI: Test on dev branch (#26) by Kevin Moore · 3 months ago
  5. 665e692 update for the 2.10 dev sdk (#25) by Jacob MacDonald · 3 months ago

Pub Package Build Status

The boolean_selector package defines a simple and flexible syntax for boolean expressions. It can be used for filtering based on user-defined expressions. For example, the test package uses boolean selectors to allow users to define what platforms their tests support.

The boolean selector syntax is based on a simplified version of Dart's expression syntax. Selectors can contain identifiers, parentheses, and boolean operators, including ||, &&, !, and ? :. Any valid Dart identifier is allowed, and identifiers may also contain hyphens. For example, chrome, chrome || content-shell, and js || (vm && linux) are all valid boolean selectors.

A boolean selector is parsed from a string using BooleanSelector.parse(), and evaluated against a set of variables using BooleanSelector.evaluate(). The variables are supplied as a function that takes a variable name and returns its value. For example:

import 'package:boolean_selector/boolean_selector.dart';

void main(List<String> args) {
  var selector = BooleanSelector.parse("(x && y) || z");
  print(selector.evaluate((variable) => args.contains(variable)));
}

Versioning

If this package adds new features to the boolean selector syntax, it will increment its major version number. This ensures that packages that expose the syntax to their users will be able to update their own minor versions, so their users can indicate that they rely on the new syntax.