-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Updated SearchDelegate to follow custom InputDecorationTheme #55209
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
Updated SearchDelegate to follow custom InputDecorationTheme #55209
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. |
Just a heads-up, this is different from #58970, that one just adds more properties coming from |
What's the status of this? The current |
@hawkinsjb1 Still waiting on something too, I believe it's still up-to-date with the latest delegate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gildaswise, so sorry it has taken me a while to get to this. Thanks for your contribution.
It looks like this has been here long enough to get out of sync with the master branch, so this will need to be updated.
The change itself looks reasonable, but we will also need a test added that verifies that this works so that no one will break this in the future.
If you are no longer interested in working on this, just let us know and we can find someone to take it on. Thx.
@darrenaustin Starting to work on this again right now, thanks for looking into it! |
Rebase branch
…meData instead of raw InputDecoration
@darrenaustin Just finished, had to change my approach to this. Before, it was meant to be a PR that fixed custom I changed it to add the I had to update two tests that relied on checking |
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took a while to get to this. Thanks so much for the contribution. There are several PRs that are attempting to solve various parts of this issue, but yours seems the most robust. I have a few issues though.
First, there are a lot of unrelated style changes here that make it hard to see what the actual fix is that you are proposing. The Flutter framework uses a different style guide from dart. Can you please revert these style changes to make it easier to review your fix?
I have other code specific comments below. Thanks again.
Finally removed all unrelated changes, so sorry about that. I checked the file diff and everything should be on point now. Just let me know about the last test comment I made and it should be fine now. Thanks for reviewing and I understand the internal user, haha. |
I just fixed the merge conflict, but the two new tests from #67679 are not working. I tried just removing my changes to see if would go fine, but it didn't. It says that
I also just added a quick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making good progress. Thanks. I still have a few requests below. The tests are breaking due to the removal of some settings on the AppBar
. I have pointed them out below as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and the tests are passing. However, I steered you the wrong way on putting those AppBar parameters back. We need to remove them, as you had it right the first time. Really sorry about that.
For the new tests that will break with them missing, we can adjust them to look at the underlying Material
widget instead of the AppBar
itself. I can't seem to put a comment on the code itself, but in the test code for 'text in search bar contrasts background (light mode)', you can change the appBar color check to:
final Material appBarBackground = tester.widget<Material>(find.descendant(
of: find.byType(AppBar),
matching: find.byType(Material),
));
expect(appBarBackground.color, Colors.white);
And the equivalent for the dark mode test.
Again, thanks for your patience and work here. I think it is really close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the work on this @gildaswise!
Thanks for reviewing, @darrenaustin! Hope everyone benefits from this asap, too. |
This pull request is not suitable for automatic merging in its current state.
|
@darrenaustin Let me know what exactly I need to change here, unfortunately the "Details" button on Google testing doesn't really help. |
Yeah, it tripped an internal test. Looking at the results I don't think it is related to your change. I am trying to figure out what is going on and will get back to you and hopefully we can land this soon. Thx. |
It was an unrelated dependency issue with the tests. I marked it as passed on the internal side and just pushed to master. Thanks again for all the time and work on this one. |
Congrats @gildaswise and @darrenaustin for not giving up and finishing this PR after 6 month! |
Still not resolved in the latest version |
Same issue |
@juliavi @intraector What Flutter version specifically are you seeing this problem on? Can you open a new issue with repro instructions? |
Description
Currently, if you start using
InputDecorationTheme
in your app,SearchDelegate
will follow it and work as intended, but if you're using something like aOutlineInputBorder
, it fails to display it properly, and even overwritingappBarTheme
with anotherInputDecorationTheme
doesn't help, because the current version ofSearchDelegate
does not apply it as aTheme
widget.This PR makes it so
AppBar
is inside aTheme
widget that applies theappBarTheme
property to the whole tree. It also moves theInputDecorationTheme
changes to that property, so the only thing indecoration:
ishintText
, and every other theming property should be added toappBarTheme
orsearchFieldDecoration
instead of directly there.Related Issues
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].