SseMethodAnnotation.fromAnnotation constructor

SseMethodAnnotation.fromAnnotation(
  1. DartObject annotation
)

Implementation

factory SseMethodAnnotation.fromAnnotation(DartObject annotation) {
  final name = getFieldValueFromDartObject(annotation, 'name');

  if (name == null) {
    throw Exception('Method name is required');
  }

  final path = getFieldValueFromDartObject(annotation, 'path');

  return SseMethodAnnotation(
    name,
    path: path,
  );
}