-
Notifications
You must be signed in to change notification settings - Fork 28.5k
StandardMessageCodec produces Map<dynamic, dynamic> but users expect Map<String, dynamic> #14556
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
Comments
Channels don't preserve Map and List type arguments: Map<String, Object> arrives as Map<dynamic, dynamic> to the receiver. In Dart 2 type system dynamic no longer serves as bottom type so Map<dynamic, dynamic> can't be assign to a variable of type Map<String, dynamic>. Issue flutter#14556
Channels don't preserve Map and List type arguments: Map<String, Object> arrives as Map<dynamic, dynamic> to the receiver. In Dart 2 type system dynamic no longer serves as bottom type so Map<dynamic, dynamic> can't be assign to a variable of type Map<String, dynamic>. Issue #14556
In addition to the above I also ran into the following runtime errors which needed to be fixed before the video demo comes up in flutter gallery
Once I worked around these errors by doing local patches in |
@a-siva would you make PR with your changes - given that you already have it fixed? |
flutter/flutter#14556 (issues encountered when running flutter gallery in strong mode).
created PR flutter/plugins#380 for addressing these issues |
* Fix signature errors to account for strong mode errors listed in flutter/flutter#14556 (issues encountered when running flutter gallery in strong mode). * Fix analyzer warnings. * Address code review comment. * Address analyzer lint issues. * Format error. * Format. * Format.
All PRs to address this have landed. |
Channels don't preserve Map and List type arguments: Map<String, Object> arrives as Map<dynamic, dynamic> to the receiver. In Dart 2 type system dynamic no longer serves as bottom type so Map<dynamic, dynamic> can't be assign to a variable of type Map<String, dynamic>. Issue flutter#14556
* Fix signature errors to account for strong mode errors listed in flutter/flutter#14556 (issues encountered when running flutter gallery in strong mode). * Fix analyzer warnings. * Address code review comment. * Address analyzer lint issues. * Format error. * Format. * Format.
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 |
Consider for example this code from
semantics_service_test
(/cc @amirh )This triggers runtime check failure in Dart 2 mode because
Map<dynamic, dynamic>
is not a subtype ofMap<String, dynamic>
.I have discussed this with @mravn-google and we decided to go by fixing the consumer side, especially because Dart lacks features needed to correctly preserve type arguments across channel boundaries for arbitrary types.
I am gonna handle updating tests in Flutter repo, while @mravn-google team is gonna take care of packages that contain similar issues, e.g. https://github.com/flutter/plugins/blob/master/packages/video_player/lib/video_player.dart#L162-L163
The text was updated successfully, but these errors were encountered: