flutter/examples/fn/widgets/style_component.dart

18 lines
387 B
Dart

part of widgets;
abstract class StyleComponent extends Component {
Node content;
// Subclasses should implement this getter to provide their style information.
Style get style => null;
StyleComponent({ Object key, this.content }) : super(key: key);
Node render() {
return new Container(
style: style,
children: content == null ? [] : [content]
);
}
}