execute method

Future<bool?> execute(
  1. String caller,
  2. String propertyOrFunction,
  3. List arguments
)

Implementation

Future<bool?> execute(
    String caller, String propertyOrFunction, List<dynamic> arguments) async {
  if (scope == null) return null;

  var function = propertyOrFunction.toLowerCase().trim();

  switch (function) {
    case 'set':
      return set(this, caller, propertyOrFunction, arguments, scope!);

    case 'addchild':
      addChild(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'removechild':
      removeChild(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'removechildren':
      removeChildren(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'replacechild':
      replaceChild(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'replacechildren':
      replaceChildren(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'removewidget':
      removeWidget(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;

    case 'replacewidget':
      replaceWidget(this, arguments);

      // force rebuild
      notifyListeners("rebuild", "true");

      return true;
  }

  return false;
}