Closed dinbtechit closed 1 year ago
No, the "reflector" class must be a direct subclass of class Reflectable
from 'package:reflectable/reflectable.dart'
, and it must have that very specific shape which is mentioned in the error message.
However, you could simply do this:
// Reflector declaration, in 'reflector_lib.dart'.
@GlobalQuantifyMetaCapability(Injectable, Reflector())
import 'package:reflectable/reflectable.dart';
class Reflector extends Reflectable {
const Reflector()
: super(
newInstanceCapability, declarationsCapability, invokingCapability);
}
class Injectable {...} // Whatever is needed.
// Usage, in some other library.
import 'reflector_lib.dart';
@Injectable(name: ServiceA)
class ServiceA {...}
I'll close the issue because I think this will address your concern. Please create a new one if needed!
That worked thank you!
Is it possible to have Annotations with Parameters? This is something we could do in
dart:mirrors
.Annotation Definition:
usage
Error: