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
Support Nullable Types on props | Flutter 2.0 and Dart 2.12 upgrade #111
Comments
Hi @Edorin9 👋 If you want to use nullable props you can just update the @override
List<Object?> get props => [name]; Hope that helps 👍 |
@Edorin9 can this be closed or are you still having trouble with nullable props? |
Thanks for the reply @felangel. We can close it for now. I've actually downgraded flutter and quit upgrading a project, since there are other packages that needs updating as well. |
@felangel I was having the same issue, with vscode, I added in the nullable operator (?) and I got this error from vscode...
Granted, my class currently doesn't have any props, so I just have |
@JakeHadley if you don’t have any props the override should be:
If you have nullable props it should be:
Hope that helps 👍 |
Ah yes, that helps a lot. Thanks!
…On Wed, Apr 28, 2021, 00:31 Felix Angelov ***@***.***> wrote:
@JakeHadley <https://github.com/JakeHadley> the override should be:
List<Object?> get props => [];
Hope that helps 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#111 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIPP6MNLEZTHBSAF45ORLQDTK6TTZANCNFSM4YSS4KDA>
.
|
@felangel Appreciate the solution. Should this be mentioned in the README? |
I can't make this work. I've tried |
Hi @felangel how about that I got the error too |
Can you share a minimal reproduction sample? |
Sorry, my bad. I found it. I need to use |
yea that's it ty |
Thank you Felix, I was looking for this solution :) |
Describe the bug
The props override property of an equatable doesn't support nullable (eg: String?) values.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No IDE errors/build errors should show up
A possible workaround on my side is to
Assign a fallback value / ternary, which I would say is not reecommended
Additional context
The element type 'String?' can't be assigned to the list type 'Object'.
The text was updated successfully, but these errors were encountered: