createBindsVar function

Expression createBindsVar(
  1. BaseParameterAnnotation annotation,
  2. ServerParam param
)

Implementation

Expression createBindsVar(
  BaseParameterAnnotation annotation,
  ServerParam param,
) {
  if (annotation is! ServerBindsAnnotation) {
    throw ArgumentError('Invalid annotation type: ${annotation.runtimeType}');
  }

  return createClass(
    annotation.bind.bind,
  ).property('bind').call([createBindContext(param)]).awaited;
}