Skip to content

Added filter callback on dropdown menu - #143939

Merged
justinmc merged 7 commits into
flutter:masterfrom
dacianf:feature/add-filter-callback-on-dropdown
Jun 3, 2024
Merged

Added filter callback on dropdown menu#143939
justinmc merged 7 commits into
flutter:masterfrom
dacianf:feature/add-filter-callback-on-dropdown

Conversation

@dacianf

Copy link
Copy Markdown
Contributor

I added a callback on DropDown Menu for filtering options. I needed this feature because I wanted to filtered data using a custom way and that was not possible. For searching there was already a callback that helped, but none for filtering.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from 8aa47ee to 4f34899CompareFebruary 22, 2024 15:44
@github-actionsgithub-actionsBot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Feb 22, 2024
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch 2 times, most recently from 9b9a75c to 3ed4b29CompareFebruary 26, 2024 15:34
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch 2 times, most recently from 6201d0d to d61b4e1CompareMarch 11, 2024 14:48
@flutter-dashboard

Copy link
Copy Markdown

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 package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from d61b4e1 to 4e6c9b0CompareApril 12, 2024 14:01
@dacianf

Copy link
Copy Markdown
ContributorAuthor

@QuncCccccc any idea when you can look over this PR?

@QuncCccccc

Copy link
Copy Markdown
Contributor

@QuncCccccc any idea when you can look over this PR?

Hi! Sorry for the late response! Overall this is a reasonable feature, will take a look very soon!

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch 5 times, most recently from fd6e724 to 7c621a4CompareApril 16, 2024 16:00
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from 7c621a4 to 6fe0afdCompareApril 23, 2024 13:50
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/test/material/dropdown_menu_test.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/test/material/dropdown_menu_test.dart Outdated
@dacianf
dacianf requested a review from QuncCcccccApril 25, 2024 09:11
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch 2 times, most recently from e16bd71 to d6fd5aaCompareApril 29, 2024 21:07
@dacianf

Copy link
Copy Markdown
ContributorAuthor

@QuncCccccc can you take one more look here, please?

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from d6fd5aa to d0e6777CompareMay 2, 2024 13:12
@dacianf

Copy link
Copy Markdown
ContributorAuthor

@QuncCccccc any updates?

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from d0e6777 to 815379eCompareMay 14, 2024 21:03
@dacianf

Copy link
Copy Markdown
ContributorAuthor

@QuncCccccc are you still around? @HansMuller Should I contact someone else?

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from 815379e to eef9a56CompareMay 15, 2024 09:23

@QuncCcccccQuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience! Just left some comments below. After fixing these, we should good to go!

Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from eef9a56 to ec9eec8CompareMay 21, 2024 06:18
@dacianf
dacianf requested a review from victorsanniMay 31, 2024 17:12
@dacianf

Copy link
Copy Markdown
ContributorAuthor

@QuncCccccc I added it. Wasn't sure if I needed to add a comment there or not.

@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from 51fb0b2 to 4632fe9CompareMay 31, 2024 17:32

@QuncCcccccQuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some suggestions below.

Just noticed I didn't click Approve last time. I will ask the second review when the comments are fixed:)! Thanks again for the contribution!

Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
@dacianf

Copy link
Copy Markdown
ContributorAuthor

LGTM with some suggestions below.

Just noticed I didn't click Approve last time. I will ask the second review when the comments are fixed:)! Thanks again for the contribution!

No worries @QuncCccccc ! I fixed the comments!

Thank you too for helping me getting it done!

@justinmcjustinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dacianf I wonder what you think about this comment about possibly setting a default value for filterCallback: https://github.com/flutter/flutter/pull/143939/files#r1621190671

Otherwise everything else is nits and this PR looks good.

Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/lib/src/material/dropdown_menu.dart Outdated
Comment threadpackages/flutter/test/material/dropdown_menu_test.dart Outdated
Comment threadpackages/flutter/test/material/dropdown_menu_test.dart Outdated
dacianfand others added 7 commits June 1, 2024 11:08
remove redundant code
revert changes on `_enableFilter` variable
fixes based on PR comments
Update packages/flutter/test/material/dropdown_menu_test.dart
Co-authored-by: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com>
@dacianf
dacianfforce-pushed the feature/add-filter-callback-on-dropdown branch from ceb5087 to 32c5675CompareJune 1, 2024 08:08
@dacianf
dacianf requested a review from justinmcJune 2, 2024 19:23

@justinmcjustinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 . Thanks for answering all of my questions and making those fixes!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok agreed, it makes sense to do this the same way as searchCallback for now.

@justinmc
justinmc merged commit a92318d into flutter:masterJun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
@dacianf
dacianf deleted the feature/add-filter-callback-on-dropdown branch June 4, 2024 07:22
hello-coder-xu pushed a commit to hello-coder-xu/flutter that referenced this pull request Jun 4, 2024
…pdate
* master: (168 commits)
Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
Roll Flutter Engine from 60a7bb2 to a6aa5d8 (2 revisions) (flutter#149627)
Roll Flutter Engine from ea72558 to 60a7bb2 (2 revisions) (flutter#149623)
Place `flutter_gpu` in the package cache. (flutter#149299)
Switch to triage-* labels for platform package triage (flutter#149614)
Roll pub packages (flutter#149617)
Fixes multi line textfield hint text gets ellipsized (flutter#148423)
Support failures-only and silent reporters in `flutter test` (flutter#148739)
[CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
Added filter callback on dropdown menu (flutter#143939)
update generated localized message files in the stocks test app (flutter#148741)
Add a simplified SimpleCascadingMenuApp example (flutter#149147)
Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
Move some benchmarks from MotoG4 to Mokey (flutter#149567)
Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
Cleanup triage reports from docs/ (flutter#149545)
Roll Flutter Engine from d81edf6 to ea72558 (1 revision) (flutter#149590)
Roll Flutter Engine from b0f4d74 to d81edf6 (1 revision) (flutter#149468)
Roll Flutter Engine from 40b868e to b0f4d74 (1 revision) (flutter#149467)
...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 6, 2024
…pdate
* master: (168 commits)
Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
Roll Flutter Engine from 60a7bb2 to a6aa5d8 (2 revisions) (flutter#149627)
Roll Flutter Engine from ea72558 to 60a7bb2 (2 revisions) (flutter#149623)
Place `flutter_gpu` in the package cache. (flutter#149299)
Switch to triage-* labels for platform package triage (flutter#149614)
Roll pub packages (flutter#149617)
Fixes multi line textfield hint text gets ellipsized (flutter#148423)
Support failures-only and silent reporters in `flutter test` (flutter#148739)
[CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
Added filter callback on dropdown menu (flutter#143939)
update generated localized message files in the stocks test app (flutter#148741)
Add a simplified SimpleCascadingMenuApp example (flutter#149147)
Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
Move some benchmarks from MotoG4 to Mokey (flutter#149567)
Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
Cleanup triage reports from docs/ (flutter#149545)
Roll Flutter Engine from d81edf6 to ea72558 (1 revision) (flutter#149590)
Roll Flutter Engine from b0f4d74 to d81edf6 (1 revision) (flutter#149468)
Roll Flutter Engine from 40b868e to b0f4d74 (1 revision) (flutter#149467)
...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 9, 2024
…pdate
* master: (181 commits)
Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
Roll Flutter Engine from 60a7bb2 to a6aa5d8 (2 revisions) (flutter#149627)
Roll Flutter Engine from ea72558 to 60a7bb2 (2 revisions) (flutter#149623)
Place `flutter_gpu` in the package cache. (flutter#149299)
Switch to triage-* labels for platform package triage (flutter#149614)
Roll pub packages (flutter#149617)
Fixes multi line textfield hint text gets ellipsized (flutter#148423)
Support failures-only and silent reporters in `flutter test` (flutter#148739)
[CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
Added filter callback on dropdown menu (flutter#143939)
update generated localized message files in the stocks test app (flutter#148741)
Add a simplified SimpleCascadingMenuApp example (flutter#149147)
Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
Move some benchmarks from MotoG4 to Mokey (flutter#149567)
Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
Cleanup triage reports from docs/ (flutter#149545)
Roll Flutter Engine from d81edf6 to ea72558 (1 revision) (flutter#149590)
Roll Flutter Engine from b0f4d74 to d81edf6 (1 revision) (flutter#149468)
Roll Flutter Engine from 40b868e to b0f4d74 (1 revision) (flutter#149467)
...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 11, 2024
* master: (181 commits)
Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
Roll Flutter Engine from 60a7bb2 to a6aa5d8 (2 revisions) (flutter#149627)
Roll Flutter Engine from ea72558 to 60a7bb2 (2 revisions) (flutter#149623)
Place `flutter_gpu` in the package cache. (flutter#149299)
Switch to triage-* labels for platform package triage (flutter#149614)
Roll pub packages (flutter#149617)
Fixes multi line textfield hint text gets ellipsized (flutter#148423)
Support failures-only and silent reporters in `flutter test` (flutter#148739)
[CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
Added filter callback on dropdown menu (flutter#143939)
update generated localized message files in the stocks test app (flutter#148741)
Add a simplified SimpleCascadingMenuApp example (flutter#149147)
Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
Move some benchmarks from MotoG4 to Mokey (flutter#149567)
Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
Cleanup triage reports from docs/ (flutter#149545)
Roll Flutter Engine from d81edf6 to ea72558 (1 revision) (flutter#149590)
Roll Flutter Engine from b0f4d74 to d81edf6 (1 revision) (flutter#149468)
Roll Flutter Engine from 40b868e to b0f4d74 (1 revision) (flutter#149467)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packageswill affect goldensChanges to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dacianf@QuncCccccc@justinmc@MitchellGoodwin@victorsanni