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) {
  var value = namedArguments[const Symbol('value')];
  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, [], {});
    };
  }
  EdgeInsets? padding;
  var paddingParsed = namedArguments[const Symbol('padding')];
  if (paddingParsed != null) {
    padding = paddingParsed as EdgeInsets;
  }
  TextStyle? style;
  var styleParsed = namedArguments[const Symbol('style')];
  if (styleParsed != null) {
    style = styleParsed as TextStyle;
  }
  bool enabled = true;
  var enabledParsed = namedArguments[const Symbol('enabled')];
  if (enabledParsed != null) {
    enabled = enabledParsed as bool;
  }
  double height = parseDouble(namedArguments[const Symbol('height')]) ?? 48.0;
  return PopupMenuItem(
    value: value,
    enabled: enabled,
    height: height,
    child: child,
    onTap: onTap,
    textStyle: style,
    padding: padding,
  );
}