executeRule static method

dynamic executeRule(
  1. Map<String, dynamic> rule,
  2. Map<String, dynamic> context
)

Implementation

static dynamic executeRule(Map<String, dynamic> rule, Map<String, dynamic> context) {
  String type = rule['type'] ?? '';

  switch (type) {
    case 'condition':
      return _executeConditionRule(rule, context);
    default:
      throw BaseError('Unknown rule type: $type');
  }
}