pub repository
mirror.p-hatan.irboolean_selector
2.1.0-nullsafety.3A flexible syntax for boolean expressions, based on a simplified version of Dart's expression syntax.
Readme
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.
Changelog
2.1.0-nullsafety.3
- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
2.1.0-nullsafety.2
- Allow prerelease versions of the 2.12 sdk.
2.1.0-nullsafety.1
- Allow 2.10 stable and 2.11.0 dev SDK versions.
2.1.0-nullsafety
- Migrate to null safety. There are no expected semantic changes.
2.0.0
- Breaking:
BooleanSelector.evaluatealways takes abool Function(String). For use cases previously passing aSet<String>, tear off the.containsmethod. For use cases passing anIterable<String>it may be worthwhile to first use.toSet()before tearing off.contains.
1.0.5
- Update package metadata & add
example/folder
1.0.4
- Now requires Dart 2.
1.0.3
- Work around an inference bug in the new common front-end.
1.0.2
- Declare compatibility with
string_scanner1.0.0.
1.0.1
- Fix all strong mode warnings.
1.0.0
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add boolean_selectorpubspec.yaml
name: boolean_selector
version: 2.1.0-nullsafety.3
description: >-
A flexible syntax for boolean expressions, based on a simplified version of
Dart's expression syntax.
homepage: https://github.com/dart-lang/boolean_selector
environment:
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
source_span: '>=1.8.0-nullsafety <1.8.0'
string_scanner: '>=1.1.0-nullsafety <1.1.0'
dev_dependencies:
pedantic: ^1.10.0-nullsafety
test: ^1.16.0-nullsafety
test_api: ^0.2.19-nullsafety
test_core: ^0.3.12-nullsafety
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0 | 2016-02-18T22:35:08.883Z | Download | c67977e3b3b184ae44f21f5373ae105abb696e9083ed61a6ba4488b3a696d270 |
| 1.0.1 | 2016-04-01T00:26:54.125Z | Download | 69df26530c9d985cc6245acd0bdb34abd8bcfc9b5e763a045be43e24c80dfdfb |
| 1.0.2 | 2016-06-21T20:55:02.570Z | Download | fd70dd881d04c4e6d89f07e0045c371551ddc083aa6f0fcb1dbab85a85b9875d |
| 1.0.3 | 2018-03-06T22:15:31.212296Z | Download | 7fa39dcbf249af7c1295809533c916d3ac36e1bc0807fa926b81298a9d28130a |
| 1.0.4 | 2018-07-12T23:50:41.904659Z | Download | b0bf93e583fd5b5bfacf3645605eab6c2950040803ac70fb8d542dced94f85c5 |
| 1.0.5 | 2019-06-19T16:16:40.958365Z | Download | f14ce062cc620db677e62efb6421256b461622d5bb44f69bd8a6d0333fd63515 |
| 2.0.0 | 2020-01-24T00:43:27.016202Z | Download | 306009f8cfe16bf280047940fff83a8fea7478f4f518257a693ee3e84ff0c537 |
| 2.1.0-nullsafety | 2020-07-29T17:40:24.612017Z | Download | 01edbce1f2455cf75afca5fd85cc942de3794ce26031e15409a531659aa1e735 |
| 2.1.0-nullsafety.1 | 2020-09-22T15:41:39.201388Z | Download | 5777b107425029e93923902589b6f6ca346dff1a17153698cfa59c1d0ac554e5 |
| 2.1.0-nullsafety.2 | 2020-10-23T21:38:03.193217Z | Download | 81c080dddc67b66e3a87be27d094a28bb72edd457c21701c0ff067d261cae75b |
| 2.1.0-nullsafety.3 | 2020-11-03T22:13:38.607893Z | Download | 86dfda9ce36092905a237219acca52ea594e3768fb635f82521b1d03a90e4808 |
| 2.1.0 | 2021-02-03T01:22:27.244271Z | Download | 5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72 |
| 2.1.1 | 2022-10-26T20:30:45.002834Z | Download | 6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66 |
| 2.1.2 | 2024-10-22T08:24:19.635674Z | Download | 8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea |
Dependencies
source_span "\u003e=1.8.0-nullsafety \u003c1.8.0"
string_scanner "\u003e=1.1.0-nullsafety \u003c1.1.0"