Conditional class

Conditionals can be used to evaluate a set of values and return a bool based on the conditional criteria.

Constructors

Conditional({List<Conditional>? conditions, EvaluationMode mode = EvaluationMode.and, Map<String, dynamic>? values})
Constructs the conditional. The mode defaults to EvaluationMode.and and may not be null.

Properties

conditions List<Conditional>?
The sub-conditions to evaluate as the criteria.
final
hashCode int
The hash code for this object.
no setterinherited
mode EvaluationMode
The mode to use when evaluating the criteria.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Map<String, dynamic>?
The key value pairs of values to evaluate against.
final

Methods

evaluate(dynamic actual) bool
Evaluats the conditional to return a bool based on the criteria and the given values. The given values must be a Map or a Map-like object that implements the [] operator or else an error will be thrown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Encodes the inner representation of this model to a json compatible map.
toString() String
Returns the string encoded JSON representation for this class. This will remove all null values and empty collections from the returned string.
inherited

Operators

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

Static Methods

fromDynamic(dynamic map) Conditional
Creates a new Conditional from a Map-like dynamic value. The map must be a Map or a Map-like object that supports the [String] operator.
maybeFromDynamic(dynamic map) Conditional?
Creates a new Conditional from a Map-like dynamic value. The map must be a Map or a Map-like object that supports the [String] operator.