Menu in StocksApp should animate out

This CL teaches PopupMenu how to animate out as well as in. Also, I've changed
the PopupMenuItem animations to be driven from the PopupMenu itself, which
makes it easier to run the animation in reverse when closing the menu.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1033913002
This commit is contained in:
Adam Barth 2015-03-25 10:40:29 -07:00
parent 0abd3c9ef3
commit 08f2a275ad

View File

@ -145,8 +145,11 @@ class StocksApp extends App {
// TODO(abarth): We should close the menu when you tap away from the // TODO(abarth): We should close the menu when you tap away from the
// menu rather than when you tap on the menu. // menu rather than when you tap on the menu.
setState(() { setState(() {
_menuController.close(); _menuController.close().then((_) {
_menuController = null; setState(() {
_menuController = null;
});
});
}); });
} }
)); ));