ServerLifecycleComponent.fromDartObject constructor

ServerLifecycleComponent.fromDartObject(
  1. ElementAnnotation annotation
)

Implementation

factory ServerLifecycleComponent.fromDartObject(
  ElementAnnotation annotation,
) {
  final element = annotation.element?.enclosingElement;

  if (element is! ClassElement) {
    throw Exception('Invalid element type');
  }

  final arguments = AnnotationArguments.fromDartObject(annotation);

  return ServerLifecycleComponent.fromClassElement(element, arguments);
}