execute method

  1. @override
Future<Map<String, dynamic>> execute(
  1. List arguments,
  2. Map<int, RxElement> elementMap
)
override

Implementation

@override
Future<Map<String, dynamic>> execute(
    List arguments, Map<int, RxElement> elementMap) async {
  // Validate arguments
  if (arguments.length < 2) {
    throw ArgumentError('Invalid arguments. Expected: [id, value]');
  }

  int id = arguments[0]; // ID of the element to interact with
  Object value = arguments[1]; // Value to set
  String propertyname = arguments[2];

  // Retrieve the element by ID
  RxElement? element = elementMap[id];
  if (element == null) {
    return {'success': false, 'message': 'Element not found'};
  }

  element.setValue(propertyname, value);
  return {'success': true};
}