From c62170006f283e894481bfc83ef6e19bd60f76e3 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 11 Mar 2015 10:17:54 -0700 Subject: [PATCH] Re-work MaterialComponent Instead of MaterialComponent being a base class, components that want material behavior simply create a MaterialComponent during their render function. This approach gives the component more flexibility as to its structure and gives MaterialComponent more flexibility has to how the components it generates are related to the existing children. Also, I've improved some of the event delegation code. There's no reason to attach event handlers to the root component you emit during |render| because the framework already delegates events from your root component to you. R=rafaelw@chromium.org Review URL: https://codereview.chromium.org/983903003 --- examples/stocks-fn/stockrow.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/stocks-fn/stockrow.dart b/examples/stocks-fn/stockrow.dart index 71c1042bae..6eb9df6480 100644 --- a/examples/stocks-fn/stockrow.dart +++ b/examples/stocks-fn/stockrow.dart @@ -1,6 +1,6 @@ part of stocksapp; -class StockRow extends Material { +class StockRow extends Component { Stock stock; @@ -62,9 +62,7 @@ class StockRow extends Material { ) ]; - children.add(super.build()); - - return new Container( + return new Material( style: _style, children: children );