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
Pigeon: using Map
or dynamic
throws Generic type arguments must be nullable in field "data"
error
#94689
Comments
@ben-xD See if above points helps |
Hey @darshankawar I re-read those points and they do not assist me 😊 Here is my
|
Thanks for the update. I see the same behavior on latest stable and master. stable, master flutter doctor -v
|
Map
Map
or dynamic
throws Generic type arguments must be nullable in field "data"
error
I'm confused about what exactly this issue is intended to be about. What you have labelled attempts 1 and 2 are, as noted above, documented limitations in Pigeon at the moment. As for attempt 3:
This doesn't seem to have anything to do with
Which of the behaviors did you verify? |
Oh, I guess you're saying the key type of a Map should be optional too. That's confusing to me, what does a Attempt 4:After fixing the class RemoteMessage {
Notification? notification;
Map<String?, dynamic>? data; // <-- This is line 5, referred to in the error
} Giving an error:
What worked:By adding
Thanks for your scrutiny @stuartmorgan, it looks like the code generation is completing now. I'll now test it at runtime. |
I've closed this issue but created a new one because the generated code when using a |
@stuartmorgan I tried the Attempt1 and 2 which had resulted in same error messages as OP and hence labeled. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
As per the Pigeon docs, I am tagging @gaaclarke to get help on this. Thanks in advance.
Attempt 1
I've tried to define a class using:
Unfortunately, I get an error message:
Attempt 2
I also tried making
dynamic
optional as well:In that case, I get only 1 instance of the error:
Attempt 3
If I make the key type optional, i.e.
Map<String?, dynamic>? data;
, I get the error:Summary
It looks like Pigeon doesn't support
Map
ordynamic
, although it should already support generics: #63468.The text was updated successfully, but these errors were encountered: