visitInvokeMethodExpr method

  1. @override
void visitInvokeMethodExpr(
  1. InvokeMethodExpr expr,
  2. EmitterVisitorContext context
)
override

Implementation

@override
void visitInvokeMethodExpr(
  o.InvokeMethodExpr expr,
  EmitterVisitorContext context,
) {
  expr.receiver.visitExpression(this, context);
  var name = expr.name;
  var builtin = expr.builtin;
  if (builtin != null) {
    name = builtin.methodName;
  }
  if (expr.checked) {
    context.print('?');
  }
  context.print('.$name(');
  visitAllExpressions(expr.args, context, ',');
  visitAllNamedExpressions(
    expr.namedArgs,
    context,
    ',',
    alwaysAddSeperator: expr.args.isNotEmpty,
  );
  context.print(')');
}