execute method

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

Implementation

@override
Future<bool?> execute(
    String caller, String propertyOrFunction, List<dynamic> arguments) async {
  if (scope == null) return null;
  var function = propertyOrFunction.toLowerCase().trim();
  switch (function) {
    case "open":
      var view = findListenerOfExactType(ModalViewState);
      if (view == null) {
        // modal width
        if (arguments.isNotEmpty) width = toStr(arguments[0]);

        // modal height
        if (arguments.length > 1) height = toStr(arguments[1]);

        // resizeable
        if (arguments.length > 2) resizeable = toBool(arguments[2]) ?? true;

        // closeable
        if (arguments.length > 3) closeable = toBool(arguments[3]) ?? true;

        // draggable
        if (arguments.length > 4) draggable = toBool(arguments[4]) ?? true;

        // modal
        if (arguments.length > 5) modal = toBool(arguments[5]) ?? true;

        open(ModalView(this));
      }
      return true;

    case "close":
      close();
      return true;
  }
  return super.execute(caller, propertyOrFunction, arguments);
}