createCookieVar function
Implementation
Expression createCookieVar(
BaseParameterAnnotation annotation,
ServerParam param,
) {
if (annotation is! ServerCookieAnnotation) {
throw ArgumentError('Invalid annotation type: ${annotation.runtimeType}');
}
final cookieVar = refer(
'context',
).property('request').property('headers').property('cookies');
return cookieVar.index(literalString(annotation.name ?? param.name));
}