Repository navigation
fix: MaterialColor Swatch Map comparison - #61974
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Piinks
left a comment
There was a problem hiding this comment.
Hi @ayaankhan98 welcome! And thank you for the contribution!
Can you revert the unrelated formatting changes here? You can refer to the Flutter Style Guide here.
The analyzer also appears to have caught some exceptions here:
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:207:33 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:208:20 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:209:20 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:220:33 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:390:33 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:391:20 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:392:20 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:403:33 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:447:33 • always_put_control_body_on_new_line
info • Separate the control structure expression from its statement • packages/flutter/lib/src/painting/colors.dart:448:43 • always_put_control_body_on_new_line
info • Prefer const with constant constructors • packages/flutter/lib/src/painting/colors.dart:451:9 • prefer_const_constructors
info • Specify type annotations • packages/flutter/lib/src/painting/colors.dart:451:9 • always_specify_types
error • Missing type arguments for generic type 'MapEquality<dynamic, dynamic>' • packages/flutter/lib/src/painting/colors.dart:451:9 • implicit_dynamic_type
Lastly, this should also have a test. That will make sure this works as intended, and more importantly it will ensure it is not undone later by another change.
okay Thanks @Piinks i will fix these issues soon. |
@Piinks where should i place test for this, in |
✅ |
Piinks
left a comment
There was a problem hiding this comment.
Thanks for updating this! Just a few nits. :)
Piinks
left a comment
There was a problem hiding this comment.
LGTM! Thank you!
The failing checks are not related to this change. Upstream is actually broken right now with this version solving problem: #62146. That will have to be fixed first, then this PR rebased for the checks to pass.
Okay, Thanks for help :) |
|
@ayaankhan98 The issue has been fixed. Can you please rebase this change to make all the checks pass? Thanks. |
@goderbauer and @Piinks , i am facing some issue with my machine therefore i am unable to rebase the commits at this time. see if anyone of you can run the checks manually. |
|
@ayaankhan98 Is your machine working again? Can you try rebasing it again? We'd have to create a new PR to do the rebase. |
Description
fixed the map comparison bug.
since
_swatchis a Map and the comparisonother._swatch == _swatch;will always return false if the Maps have different hashCodes.therefore the
==is replaced byMapEquality().equals(other._swatch,_swatch)Related Issues
Fixes #61888
Tests
This is the bug reproducible code
before changing the
==byMapEquality().equals(other._swatch,_swatch)the output was
after implementing changes the output is as expected
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.