Commit 409b12e5 authored by Rafael Weinstein's avatar Rafael Weinstein

Change the name of Component.render to Component.build in Effen.

"Render" is misleading. "Build" may not be the best word either, it's closer to what's actually happening.

R=ojan@chromium.org
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/992033002
parent b7d9e475
This diff is collapsed.
...@@ -27,7 +27,7 @@ class Box extends Component { ...@@ -27,7 +27,7 @@ class Box extends Component {
Box({String key, this.title, this.children }) : super(key: key); Box({String key, this.title, this.children }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _style, style: _style,
children: [ children: [
......
...@@ -29,11 +29,11 @@ class Button extends ButtonBase { ...@@ -29,11 +29,11 @@ class Button extends ButtonBase {
Button({ Object key, this.content }) : super(key: key); Button({ Object key, this.content }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
key: 'Button', key: 'Button',
style: _highlight ? _highlightStyle : _style, style: _highlight ? _highlightStyle : _style,
children: [super.render(), content] children: [super.build(), content]
); );
} }
} }
...@@ -54,11 +54,11 @@ class Checkbox extends ButtonBase { ...@@ -54,11 +54,11 @@ class Checkbox extends ButtonBase {
Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key); Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _style, style: _style,
children: [ children: [
super.render(), super.build(),
new Container( new Container(
style: _highlight ? _containerHighlightStyle : _containerStyle, style: _highlight ? _containerHighlightStyle : _containerStyle,
children: [ children: [
......
...@@ -152,7 +152,7 @@ class Drawer extends Component { ...@@ -152,7 +152,7 @@ class Drawer extends Component {
}); });
} }
Node render() { Node build() {
_ensureListening(); _ensureListening();
bool isClosed = _position <= -_kWidth; bool isClosed = _position <= -_kWidth;
......
...@@ -27,7 +27,7 @@ class DrawerHeader extends Component { ...@@ -27,7 +27,7 @@ class DrawerHeader extends Component {
DrawerHeader({ Object key, this.children }) : super(key: key); DrawerHeader({ Object key, this.children }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _style, style: _style,
children: [ children: [
......
...@@ -32,7 +32,7 @@ abstract class FixedHeightScrollable extends Component { ...@@ -32,7 +32,7 @@ abstract class FixedHeightScrollable extends Component {
this.maxOffset this.maxOffset
}) : super(key: key) {} }) : super(key: key) {}
List<Node> renderItems(int start, int count); List<Node> buildItems(int start, int count);
void didMount() { void didMount() {
var root = getRoot(); var root = getRoot();
...@@ -48,7 +48,7 @@ abstract class FixedHeightScrollable extends Component { ...@@ -48,7 +48,7 @@ abstract class FixedHeightScrollable extends Component {
}); });
} }
Node render() { Node build() {
var itemNumber = 0; var itemNumber = 0;
var drawCount = 1; var drawCount = 1;
var transformStyle = ''; var transformStyle = '';
...@@ -73,7 +73,7 @@ abstract class FixedHeightScrollable extends Component { ...@@ -73,7 +73,7 @@ abstract class FixedHeightScrollable extends Component {
new Container( new Container(
style: _scrollAreaStyle, style: _scrollAreaStyle,
inlineStyle: transformStyle, inlineStyle: transformStyle,
children: renderItems(itemNumber, drawCount) children: buildItems(itemNumber, drawCount)
) )
] ]
) )
......
...@@ -30,8 +30,8 @@ class FloatingActionButton extends MaterialComponent { ...@@ -30,8 +30,8 @@ class FloatingActionButton extends MaterialComponent {
FloatingActionButton({ Object key, this.content }) : super(key: key); FloatingActionButton({ Object key, this.content }) : super(key: key);
Node render() { Node build() {
List<Node> children = [super.render()]; List<Node> children = [super.build()];
if (content != null) if (content != null)
children.add(content); children.add(content);
......
...@@ -15,7 +15,7 @@ class Icon extends Component { ...@@ -15,7 +15,7 @@ class Icon extends Component {
this.type: '' this.type: ''
}) : super(key: key); }) : super(key: key);
Node render() { Node build() {
String category = ''; String category = '';
String subtype = ''; String subtype = '';
List<String> parts = type.split('/'); List<String> parts = type.split('/');
......
...@@ -80,7 +80,7 @@ class InkSplash extends Component { ...@@ -80,7 +80,7 @@ class InkSplash extends Component {
}); });
} }
Node render() { Node build() {
_ensureListening(); _ensureListening();
return new Container( return new Container(
......
...@@ -17,7 +17,7 @@ abstract class MaterialComponent extends Component { ...@@ -17,7 +17,7 @@ abstract class MaterialComponent extends Component {
MaterialComponent({ Object key }) : super(key: key); MaterialComponent({ Object key }) : super(key: key);
Node render() { Node build() {
List<Node> children = []; List<Node> children = [];
if (_splashes != null) { if (_splashes != null) {
......
...@@ -9,7 +9,7 @@ class MenuDivider extends Component { ...@@ -9,7 +9,7 @@ class MenuDivider extends Component {
MenuDivider({ Object key }) : super(key: key); MenuDivider({ Object key }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _style style: _style
); );
......
...@@ -35,11 +35,11 @@ class MenuItem extends ButtonBase { ...@@ -35,11 +35,11 @@ class MenuItem extends ButtonBase {
MenuItem({ Object key, this.icon, this.children }) : super(key: key); MenuItem({ Object key, this.icon, this.children }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _highlight ? _highlightStyle : _style, style: _highlight ? _highlightStyle : _style,
children: [ children: [
super.render(), super.build(),
new Icon( new Icon(
style: _iconStyle, style: _iconStyle,
size: 24, size: 24,
......
...@@ -45,11 +45,11 @@ class Radio extends ButtonBase { ...@@ -45,11 +45,11 @@ class Radio extends ButtonBase {
this.groupValue this.groupValue
}) : super(key: key); }) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _highlight ? _highlightStyle : _style, style: _highlight ? _highlightStyle : _style,
children: value == groupValue ? children: value == groupValue ?
[super.render(), new Container( style : _dotStyle )] : [super.render()] [super.build(), new Container( style : _dotStyle )] : [super.build()]
)..events.listen('click', _handleClick); )..events.listen('click', _handleClick);
} }
......
...@@ -16,7 +16,7 @@ class Toolbar extends Component { ...@@ -16,7 +16,7 @@ class Toolbar extends Component {
Toolbar({String key, this.children}) : super(key: key); Toolbar({String key, this.children}) : super(key: key);
Node render() { Node build() {
return new Container( return new Container(
style: _style, style: _style,
children: children children: children
......
...@@ -67,7 +67,7 @@ class StockArrow extends Component { ...@@ -67,7 +67,7 @@ class StockArrow extends Component {
return _kRedColors[_colorIndexForPercentChange(percentChange)]; return _kRedColors[_colorIndexForPercentChange(percentChange)];
} }
Node render() { Node build() {
String border = _colorForPercentChange(percentChange).toString(); String border = _colorForPercentChange(percentChange).toString();
bool up = percentChange > 0; bool up = percentChange > 0;
String type = up ? 'bottom' : 'top'; String type = up ? 'bottom' : 'top';
......
...@@ -9,7 +9,7 @@ class Stocklist extends FixedHeightScrollable { ...@@ -9,7 +9,7 @@ class Stocklist extends FixedHeightScrollable {
this.stocks this.stocks
}) : super(key: key, minOffset: 0.0); }) : super(key: key, minOffset: 0.0);
List<Node> renderItems(int start, int count) { List<Node> buildItems(int start, int count) {
var items = []; var items = [];
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
items.add(new StockRow(stock: stocks[start + i])); items.add(new StockRow(stock: stocks[start + i]));
......
...@@ -34,7 +34,7 @@ class StockRow extends MaterialComponent { ...@@ -34,7 +34,7 @@ class StockRow extends MaterialComponent {
this.stock = stock; this.stock = stock;
} }
Node render() { Node build() {
String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}"; String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%"; String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
...@@ -62,7 +62,7 @@ class StockRow extends MaterialComponent { ...@@ -62,7 +62,7 @@ class StockRow extends MaterialComponent {
) )
]; ];
children.add(super.render()); children.add(super.build());
return new Container( return new Container(
style: _style, style: _style,
......
...@@ -33,7 +33,7 @@ class StocksApp extends App { ...@@ -33,7 +33,7 @@ class StocksApp extends App {
StocksApp() : super(); StocksApp() : super();
Node render() { Node build() {
var drawer = new Drawer( var drawer = new Drawer(
animation: _drawerAnimation, animation: _drawerAnimation,
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