-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
The borderRadius
property is missing from equality and hashCode in UnderlineInputBorder
, equality and hashCode tests of UnderlineInputBorder
and OutlineInputBorder
are not exhaustive
#118282
Comments
Reproducible using the test cases provided above. logs
flutter doctor -v
|
@TahaTesser just as a curiosity, the reason why I found this issue was because if you in FlexColorScheme's ThemesPlayground https://rydmike.com/flexcolorscheme/themesplayground-v6 go to TextField interactive theming panel, select underline input border and change its border radius it does not update, like when using the outline input border. The update does not happen until you also change something else in ThemeData that makes it "unequal" and triggers the rebuild. So toggling from underline to outline, after a change in border radius, will show it on the outline and then when toggling back to underline, it will be shown on underline input border as well. Demoed with a GIF recording here. So I wondered why it happens and found this issue as the cause. Actually known it for a while, I was just lazy reporting it, see this log in docs about it: Maybe there is some reason why the quality check is the way it is? I can't see one though. Probably it was just forgotten to be added when underline input border at some later point received the border radius prop on top edges. That's my guess anyway. |
I can see I myself sometimes forget to update the hash code. I agree with your assessment that it must've been forgotten. |
borderRadius
property is missing from equality and hashCode in UnderlineInputBorder
borderRadius
property is missing from equality and hashCode in UnderlineInputBorder
, equality and hashCode tests of UnderlineInputBorder
and OutlineInputBorder
are not exhaustive
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 |
The
UnderlineInputBorder
has equality and hashCode gapThe
borderRadius
property is missing from equality andhashCode
inUnderlineInputBorder
. This causes update issues inThemeData
if a theme changes only the upper side border radius in anInputDecoratorTheme
, the application theme does not update since theUnderlineInputBorder
is seen as identical.The
UnderlineInputBorder
has propertiesborderSide
andborderRadius
, but onlyborderSide
is included in equality and hashCode.flutter/packages/flutter/lib/src/material/input_border.dart
Line 134 in 0b97874
However
borderRadius
is not included inhashCode
or equality.flutter/packages/flutter/lib/src/material/input_border.dart
Line 237 in 0b97874
Q: Is there some reason why the
UnderlineInputBorder
equality is designed this way?This gap causes certain theme updates to fail.
Will try to submit a fix PR.
Expected results
Expect these unit tests to pass:
Actual results
The tests FAIL.
The existing tests for
UnderlineInputBorder
andOutlineInputBorder
are not exhaustive enough to capture an issue like this. Only theUnderlineInputBorder
has this gap, theOutlineInputBorder
does not have the same issue, but if it would have had a similar gap, its current test would not have caught the issue.Proposal
borderRadius
to equality andhashCode
ofUnderlineInputBorder
.UnderlineInputBorder
andOutlineInputBorder
to capture a gap like this.Used Flutter Version
Tested on channel master, 3.7.0-15.0.pre.16
This issue exists on all channels.
flutter doctor -v
The text was updated successfully, but these errors were encountered: