Commit c6217000 authored by Adam Barth's avatar Adam Barth

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
parent ceddf0e5
part of stocksapp; part of stocksapp;
class StockRow extends Material { class StockRow extends Component {
Stock stock; Stock stock;
...@@ -62,9 +62,7 @@ class StockRow extends Material { ...@@ -62,9 +62,7 @@ class StockRow extends Material {
) )
]; ];
children.add(super.build()); return new Material(
return new Container(
style: _style, style: _style,
children: children children: children
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment