Profiles class abstract

A profile predicate used by Environment to determine if given profile expressions match the active/default profiles.

Example:

final profiles = Profiles.of(['dev & !test']);
final matches = profiles.matches((p) => ['dev'].contains(p)); // true

Expressions support:

  • Logical NOT: !profile
  • Logical AND: profile1 & profile2
  • Logical OR: profile1 | profile2
  • Parentheses: (profile1 & !profile2) | profile3

Constructors

Profiles()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

matches(bool isProfileActive(String profile)) bool
Evaluates the profile predicate against a profile tester function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(List<String> expressions) Profiles
Factory method for parsing profile expressions into a Profiles instance.