• Adam Barth's avatar
    Fix DropdownButton regression (#6353) · 6399a3af
    Adam Barth authored
    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
    6399a3af
popup_menu.dart 16.1 KB