Remove the |style| parameter from Material

There's no reason for Material to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1030963005
This commit is contained in:
Adam Barth 2015-03-25 10:42:19 -07:00
parent c6fa902d79
commit bfd2651acb
5 changed files with 25 additions and 33 deletions

View File

@ -25,10 +25,8 @@ class Button extends Component {
Button({ Object key, this.content, this.level }) : super(key: key);
Node build() {
return new Material(
style: _style,
children: [content],
level: level
);
return new StyleNode(
new Material(children: [content], level: level),
_style);
}
}

View File

@ -134,13 +134,13 @@ class Drawer extends AnimatedComponent {
onGestureFlingStart: controller.handleFlingStart
);
Material content = new Material(
key: 'Content',
style: _contentStyle,
inlineStyle: contentInlineStyle,
children: children,
level: level
);
Node content = new StyleNode(
new Material(
key: 'Content',
inlineStyle: contentInlineStyle,
children: children,
level: level),
_contentStyle);
return new EventTarget(
new Container(

View File

@ -3,8 +3,9 @@
// found in the LICENSE file.
import '../fn.dart';
import 'material.dart';
import '../theme/colors.dart';
import 'ink_well.dart';
import 'material.dart';
class FloatingActionButton extends Component {
// TODO(abarth): We need a better way to become a container for absolutely
@ -41,15 +42,8 @@ class FloatingActionButton extends Component {
children.add(content);
return new Container(
key: "Container",
style: level > 0 ? _style.extend(Material.shadowStyle[level]) : _style,
children: [
new Material(
key: "Clip",
style: _clipStyle,
children: children
)
]
children: [new StyleNode(new InkWell(children: children), _clipStyle)]
);
}
}

View File

@ -16,21 +16,20 @@ class Material extends Component {
new Style('box-shadow: ${Shadow[5]}'),
];
Style style;
String inlineStyle;
List<Node> children;
int level;
Material({
Object key,
this.style,
this.inlineStyle,
this.children,
this.level: 0 }) : super(key: key);
Object key,
this.inlineStyle,
this.children,
this.level: 0
}) : super(key: key);
Node build() {
return new StyleNode(
new InkWell(inlineStyle: inlineStyle, children: children),
level > 0 ? style.extend(shadowStyle[level]) : style);
shadowStyle[level]);
}
}

View File

@ -87,10 +87,11 @@ class PopupMenu extends AnimatedComponent {
return new PopupMenuItem(key: i++, children: item, opacity: opacity);
}));
return new Material(
style: _style,
inlineStyle: _inlineStyle(),
children: children,
level: level);
return new StyleNode(
new Material(
inlineStyle: _inlineStyle(),
children: children,
level: level),
_style);
}
}