BooleanCondition class final

A simple boolean condition configuration with optional evaluation delay.

Features:

  • Basic true/false evaluation
  • Configurable evaluation delay
  • String value conversion
  • Asynchronous evaluation

Example:

// Simple boolean condition
final condition = BooleanCondition(
  value: true,
);

// With evaluation delay
final condition = BooleanCondition(
  value: true,
  evaluationDelayInSeconds: 2,
);

// In a conditional content
final conditional = Conditional(
  condition: Condition(
    configuration: BooleanCondition(value: true),
  ),
  cases: [
    CaseItem(
      value: 'true',
      item: EnabledContent(),
    ),
    CaseItem(
      value: 'false',
      item: DisabledContent(),
    ),
  ],
  defaultCase: 'false',
);

The condition:

  • Returns 'true' or 'false' as strings
  • Can delay evaluation for testing/simulation
  • Useful for simple toggles and flags
Inheritance
  • Object
  • ConditionConfiguration
  • BooleanCondition
Annotations
  • @JsonSerializable.new()

Constructors

BooleanCondition({bool value = false, int evaluationDelayInSeconds = 0})
BooleanCondition.fromJson(Map<String, dynamic> json)
factory

Properties

evaluationDelayInSeconds → int
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaType → String
The schema type of this configuration.
finalinherited
title → String?
Optional title for this configuration.
finalinherited
value → bool
final

Methods

execute(BuildContext context) → Future<String?>
Evaluates this condition configuration.
override
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 Properties

typeDescriptor → TypeDescriptor<BooleanCondition>
final

Constants

schemaName → const String