ControllerAnnotation.fromAnnotation constructor
ControllerAnnotation.fromAnnotation(
- DartObject annotation
Implementation
factory ControllerAnnotation.fromAnnotation(DartObject annotation) {
final path = annotation.getField('path')?.toStringValue();
if (path == null) {
throw Exception('Controller path is required');
}
final type = annotation.getField('type')?.variable?.displayName;
if (type == null) {
throw Exception('Controller type is required');
}
return ControllerAnnotation(path, type: InstanceType.values.byName(type));
}