getParams function

({Map<String, Expression> named, Iterable<Expression> positioned}) getParams(
  1. Iterable<ServerParam> params, {
  2. Expression? defaultExpression,
  3. Map<String, Expression> inferredParams = const {},
})

Implementation

({Iterable<Expression> positioned, Map<String, Expression> named}) getParams(
  Iterable<ServerParam> params, {
  Expression? defaultExpression,
  Map<String, Expression> inferredParams = const {},
}) {
  final positioned = <Expression>[];
  final named = <String, Expression>{};

  for (final param in params) {
    final arg = createParamArg(
      param,
      defaultExpression: defaultExpression,
      customParams: inferredParams,
    );

    if (param.isNamed) {
      named[param.name] = arg;
    } else {
      positioned.add(arg);
    }
  }
  return (positioned: positioned, named: named);
}