-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reading enum from ConstantReader #3
Labels
usage
How to use the library
Comments
The extension You could either:
// Adding a decoder for constants of type StrategyEnum?.
GenericReader.addDecoder<StrategyEnum?>((constantReader) {
if (constantReader.isNull) {
return null;
}else{
return constantReader.get<StrategyEnum>();
}
});
final strategy = constantReader.get<StrategyEnum>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Im trying to get enum from ConstantReader. Ive found your library and tried to use it.
I have annotation with
StrategyEnum? strategy
property. So In my code where Im trying to read thestrategy
property I tried thisUnfortunately it threw error:
ErrorOf<ConstantReader>: "Input does not represent an object of type <StrategyEnum?>"
I think I may be using your generic_reader incorrectly as I would expect
get
method to accept property name 🤔Thanks in advance!
The text was updated successfully, but these errors were encountered: