From 08f2a275ad0c7d6163ccd17380cf99e11cf78e2d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 25 Mar 2015 10:40:29 -0700 Subject: [PATCH] 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 --- examples/stocks-fn/lib/stock_app.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/stocks-fn/lib/stock_app.dart b/examples/stocks-fn/lib/stock_app.dart index 1e59d3fdcf4..8eacdc827fb 100644 --- a/examples/stocks-fn/lib/stock_app.dart +++ b/examples/stocks-fn/lib/stock_app.dart @@ -145,8 +145,11 @@ class StocksApp extends App { // TODO(abarth): We should close the menu when you tap away from the // menu rather than when you tap on the menu. setState(() { - _menuController.close(); - _menuController = null; + _menuController.close().then((_) { + setState(() { + _menuController = null; + }); + }); }); } ));