Make the menu items in the drawer change colour when tapped, per Material spec.
This is done by the following steps: - Make Inherited classes notify their descendants when their state changes. - Make Components track which Inherited classes they looked at. - Make Components handle being notified of state changes by rebuilding if the changed ancestor is of a type we've looked at. - Refactor setState() and scheduleBuild(). - Make the "buildDirtyComponents" phase support incrementally building more components as each one finds it needs to update itself. The way this works is that when the menu item updates its color, it does so by changing a DefaultTextStyle (Inherited) node in its tree. That node then notifies its ancestors, which include in particular the Text component, which uses DefaultTextStyle. The notification is received, and, even though we're already in the rebuild phase, the Text queues itself up to be rebuilt as well. Since we now support adding people to the rebuild phase while it's active, it gets rebuilt as well, and all is well. This CL depends on the fix in https://codereview.chromium.org/1218183009 R=abarth@chromium.org Review URL: https://codereview.chromium.org/1222823004.
Showing
想要评论请 注册 或 登录