ServerQueryAnnotation.fromElement constructor

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

Implementation

factory ServerQueryAnnotation.fromElement(
  DartObject object,
  // ignore: avoid_unused_constructor_parameters
  ElementAnnotation annotation,
) {
  final name = object.getField('name')?.toStringValue();
  final pipe = object.getField('pipe')?.toTypeValue();
  final all = object.getField('all')?.toBoolValue();

  return ServerQueryAnnotation(
    all: all ?? false,
    name: name,
    pipe: ServerPipe.fromType(pipe),
  );
}