RulesController class

Controller that integrates rules engine with Obsly Flutter SDK

Properties

appContext → AppContext
Current application context
no setter
hashCode → int
The hash code for this object.
no setterinherited
isActive → bool
Whether rules engine is active
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addVariable(String scope, String name, dynamic value) → void
Add a variable to the context
executeActionForTest(ActionResult action) → Future<void>
Test-only method to execute an action
executeCustomRules(Map<String, dynamic> context) → Future<RulesResult>
Execute rules with custom context
executeRule(Map<String, dynamic> ruleDefinition, [Map<String, dynamic>? context]) → Future<RulesResult>
Execute a specific rule definition with optional explicit context
getSupportedNodeTypes() → Future<List<String>>
Get supported node types
isObslySDKConnectedForTest() → bool
Test-only method to check if Obsly SDK is connected
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onHttpEvent({required String url, required String method, required int statusCode, bool timeout = false, int duration = 0, dynamic requestBody, dynamic responseBody}) → Future<void>
Process HTTP event and execute rules
onNavigationEvent({String? fromRoute, String? toRoute, Map<String, dynamic>? routeArguments}) → Future<void>
Process navigation event and execute rules
onUIEvent({String? elementId, String? widgetPath, String? action, Map<String, dynamic>? metadata}) → Future<void>
Process UI event and execute rules
processRulesResultForTest(RulesResult result) → Future<void>
Test-only method to process rules results
sendMetricForTest(MetricResult metric) → Future<void>
Test-only method to send a metric
sendTagForTest(TagResult tag) → Future<void>
Test-only method to send a tag
setObslySDK(dynamic obslySDK) → void
Set the Obsly SDK reference for integration
testEngine() → Future<RulesResult>
Test the rules engine
toString() → String
A string representation of this object.
inherited
updateAppContext(AppContext context) → void
Update the application context
validateRules(Map<String, dynamic> nodes) → Future<bool>
Validate rule nodes

Operators

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

Static Properties

instance → RulesController
Get the singleton instance Note: You should call initialize() first to properly set up the engine
no setter

Static Methods

initialize() → Future<RulesController>
Initialize the rules controller
resetForTesting() → void
Reset singleton instance for testing