call method

  1. @override
Object? call(
  1. Interpreter interpreter,
  2. List<Object?> arguments,
  3. Map<Symbol, Object?> namedArguments
)
override

Implementation

@override
Object? call(Interpreter interpreter, List<Object?> arguments,
    Map<Symbol, Object?> namedArguments) {
  Widget? child;
  var childParsed = namedArguments[const Symbol('child')];
  if (childParsed != null) {
    child = childParsed as Widget;
  }
  Function()? onTap;
  var onTapParsed = namedArguments[const Symbol('onTap')];
  if (onTapParsed != null) {
    onTap = () {
      (onTapParsed as LoxFunction).call(interpreter, [], {});
    };
  }
  Function()? onDoubleTap;
  var onDoubleTapParsed = namedArguments[const Symbol('onDoubleTap')];
  if (onDoubleTapParsed != null) {
    onDoubleTap = () {
      (onDoubleTapParsed as LoxFunction).call(interpreter, [], {});
    };
  }
  Function()? onLongPress;
  var onLongPressParsed = namedArguments[const Symbol('onLongPress')];
  if (onLongPressParsed != null) {
    onLongPress = () {
      (onLongPress as LoxFunction).call(interpreter, [], {});
    };
  }

  return GestureDetector(
    child: child,
    onTap: onTap,
    onDoubleTap: onDoubleTap,
    onLongPress: onLongPress,
  );
}