ServerBodyAnnotation.fromElement constructor

ServerBodyAnnotation.fromElement(
  1. DartObject object,
  2. ElementAnnotation annotation
)

Implementation

factory ServerBodyAnnotation.fromElement(
  DartObject object,
  // ignore: avoid_unused_constructor_parameters
  ElementAnnotation annotation,
) {
  final access = object.getField('access')?.toListValue()?.map((e) {
    return e.toStringValue()!;
  }).toList();

  final pipe = object.getField('pipe')?.toTypeValue();

  return ServerBodyAnnotation(
    access: access,
    pipe: ServerPipe.fromType(pipe),
  );
}