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 child = namedArguments[const Symbol('child')];
  if (child == null) {
    throw "child required in DropdownFullWidth.";
  }
  var itemBuilder = namedArguments[const Symbol('itemBuilder')];
  if (itemBuilder == null) {
    throw "itemBuilder required in ListView.builder";
  }
  EdgeInsetsGeometry padding = const EdgeInsets.all(8);
  var paddingParse = namedArguments[const Symbol('padding')];
  if (paddingParse != null) {
    padding = paddingParse as EdgeInsetsGeometry;
  }
  double? elevation = parseDouble(namedArguments[const Symbol('elevation')]);
  bool enabled = true;
  var enabledParse = namedArguments[const Symbol('enabled')];
  if (enabledParse != null) {
    enabled = enabledParse as bool;
  }
  Widget? icon;
  var iconParse = namedArguments[const Symbol('icon')];
  if (iconParse != null) {
    icon = iconParse as Widget;
  }
  double? iconSize = parseDouble(namedArguments[const Symbol('iconSize')]);
  BorderRadius? borderRadius;
  var borderRadiusParse = namedArguments[const Symbol('borderRadius')];
  if (borderRadiusParse != null) {
    borderRadius = borderRadiusParse as BorderRadius;
  }
  Offset offset = Offset.zero;
  var offsetParse = namedArguments[const Symbol('offset')];
  if (offsetParse != null) {
    offset = offsetParse as Offset;
  }
  Color? color;
  var colorParse = namedArguments[const Symbol('color')];
  if (colorParse != null) {
    color = colorParse as Color;
  }
  Object? initValue = namedArguments[const Symbol('initValue')];
  Function(Object?)? onSelected;
  var onSelectedParse = namedArguments[const Symbol('onSelected')];
  if (onSelectedParse != null) {
    onSelected = (v) {
      (onSelectedParse as LoxFunction).call(interpreter, [v], {});
    };
  }
  ShapeBorder? shape;
  var shapeParse = namedArguments[const Symbol('shape')];
  if (shapeParse != null) {
    shape = shapeParse as ShapeBorder;
  }
  return PopupMenuFilter(
    child: child as Widget,
    initValue: initValue,
    elevation: elevation,
    offset: offset,
    icon: icon,
    onSelected: onSelected,
    shape: shape,
    color: color,
    iconSize: iconSize,
    enabled: enabled,
    borderRadius: borderRadius,
    padding: padding,
    itemBuilder: (BuildContext context) {
      return ((itemBuilder as LoxCallable).call(interpreter, [context], {})
              as List)
          .cast<PopupMenuEntry<Object>>();
    },
  );
}