Skip to content

Conversation

@abarth
Copy link
Contributor

@abarth abarth commented Oct 17, 2016

When I changed how routes complete their futures, I broke the Dropdown
button because it was still waiting for its own Completer to complete
instead of using the Future returned by push. This patch fixes that
issue.

I've also removed the previous behavior of the DropdownButton forwarding
its text style to its route. The mechansim that we were using doesn't
work properly in all cases. For example, if the DropdownButton is a
child of a LayoutBuilder, then the route will have already built by the
time the DropdownButton gets a chance to forward its text style, causing
an assert in setState.

Finally, I've tweaked PopupMenuButton to work the same way as
DropdownButton in a couple corner cases (e.g., not calling the changed
callback if the button was removed from the tree before the menu
completed its Future).

Fixes #6352

@abarth
Copy link
Contributor Author

abarth commented Oct 17, 2016

@Hixie @HansMuller

@abarth abarth changed the title Make DropdownButton regression Fix DropdownButton regression Oct 17, 2016
When I changed how routes complete their futures, I broke the Dropdown
button because it was still waiting for its own Completer to complete
instead of using the Future returned by push. This patch fixes that
issue.

I've also removed the previous behavior of the DropdownButton forwarding
its text style to its route. The mechansim that we were using doesn't
work properly in all cases. For example, if the DropdownButton is a
child of a LayoutBuilder, then the route will have already built by the
time the DropdownButton gets a chance to forward its text style, causing
an assert in setState.

Finally, I've tweaked PopupMenuButton to work the same way as
DropdownButton in a couple corner cases (e.g., not calling the changed
callback if the button was removed from the tree before the menu
completed its Future).

Fixes flutter#6352
@jason-simmons
Copy link
Member

LGTM

@abarth abarth merged commit 6399a3a into flutter:master Oct 17, 2016
@abarth abarth deleted the fix_drop_down branch October 17, 2016 17:00
a-siva added a commit that referenced this pull request Sep 27, 2018
Contains the following changes:

d80c1de (HEAD -> master, upstream/master) Roll src/third_party/skia ab3144c3abb9..656cefe65d62 (11 commits) (#6362)
edf6249 Add pushOffset to SceneBuilder (#6349)
3a01f39 Change log level from ERROR to WARNING (#6361)
5ae4708 Roll src/third_party/skia 227d4e10276c..ab3144c3abb9 (11 commits) (#6360)
763627f Do not export libdart symbols (#6337)
3052dbd SystemNavigator.pop can pop w/o UINavigationController (#6341)
0c096f7 Roll src/third_party/skia b3e48afc936d..227d4e10276c (1 commits) (#6359)
b8c2a17 Roll src/third_party/skia cfe1264d7465..b3e48afc936d (3 commits) (#6356)
c589b31 Expose push/popRoute on FlutterViewController (#6347)
075b3fc Roll src/third_party/skia 5ea41fc89b26..cfe1264d7465 (1 commits) (#6355)
2dd9b99 Roll Dart to version 808ed6238b9262660e31ea826f7aea6cfa3a3493 (#6354)
5b79938 Dont make any binaries specify an X11 dependency. (#6353)
309ac4e V0.8.2 fix compile problem with xcode10 (#6339)
26fdd1e Roll src/third_party/skia 5767fc042834..5ea41fc89b26 (3 commits) (#6351)
cc44ca5 Perform persistent cache stores on the IO thread outside the frame workload. (#6350)
f2a3df9 Wire up the Skia persistent GPU related artifacts cache. (#6278)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DropdownButton doesn't change value and can't be used twice

2 participants