RulesManager class
Manager for handling remote and manual rules in the SDK Responsible for:
- Fetching remote rules via ObslyToolsController
- Managing manually added rules from Obsly Tools
- Sanitizing and optimizing rules (removing context)
- Maintaining unified active rules list
Properties
-
activeRules
→ List<
Map< String, dynamic> > -
Get all active rules (remote + manual)
no setter
- activeRulesCount → int
-
Get count of active rules
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
RulesEventListener listener) → void - Add a rules event listener
-
addManualRule(
Map< String, dynamic> ruleDefinition) → Future<bool> - Add a manual rule from Obsly Tools
-
clear(
) → Future< void> - Clear all data (for testing)
-
clearManualRules(
) → Future< void> - Clear all manual rules
-
executeRulesForEvent(
{required String eventType, required Map< String, dynamic> context, Map<String, dynamic> ? specificRule}) → Future<List< RulesExecutionResult> > - UNIFIED METHOD: Execute all applicable rules for an event
-
exportRules(
) → String - Export all rules for debugging
-
getManualRulesCount(
) → Future< int> - Get manual rules count
-
getRulesByEventType(
String eventType) → List< Map< String, dynamic> > - Get rules filtered by event type
-
hasManualRule(
String ruleKey) → Future< bool> - Check if a manual rule exists
-
initialize(
) → Future< void> - Initialize the rules manager
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyRuleExecutionCompleted(
RulesExecutionResult result) → void - Notify listeners that rule execution completed
-
notifyRuleExecutionStarted(
String ruleKey, Map< String, dynamic> context) → void - Notify listeners that rule execution started
-
notifyRulesExecutionError(
String error, Map< String, dynamic> context) → void - Notify listeners of rules execution error
-
refreshRules(
) → Future< void> - Refresh rules from all sources (remote + manual)
-
removeListener(
RulesEventListener listener) → void - Remove a rules event listener
-
removeManualRule(
String ruleKey) → Future< bool> - Remove a manual rule
-
setRulesController(
RulesController? controller) → void - Set the rules controller from RulesIntegration
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → RulesManager
-
no setter