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 {

  /// setter
  if (scope == null) return null;
  var function = propertyOrFunction.toLowerCase().trim();

  switch (function) {

  // scroll +/- pixels
    case "scroll":
      scroll(toDouble(elementAt(arguments, 0)), animate: toBool(elementAt(arguments, 1)) ?? true);
      return true;

  // scroll to item by id
    case "scrollto":
      scrollTo(toStr(elementAt(arguments, 0)), toStr(elementAt(arguments, 1)), animate: toBool(elementAt(arguments, 2)) ?? true);
      return true;
  }
  return super.execute(caller, propertyOrFunction, arguments);
}