Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: sky/framework/components/floating_action_button.dart

Issue 1003553002: Update Button to be made of Material (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/framework/components/floating_action_button.dart
diff --git a/sky/framework/components/floating_action_button.dart b/sky/framework/components/floating_action_button.dart
index 0ed0fb89baa393b0ca336725f2e2aa83299cc51d..ab7338eb733c8246abee3b32f578227409149f74 100644
--- a/sky/framework/components/floating_action_button.dart
+++ b/sky/framework/components/floating_action_button.dart
@@ -18,7 +18,6 @@ class FloatingActionButton extends Component {
height: 56px;
background-color: ${Red[500]};
color: white;
- box-shadow: ${Shadow[3]};
border-radius: 28px;'''
);
static final Style _clipStyle = new Style('''
@@ -34,8 +33,10 @@ class FloatingActionButton extends Component {
-webkit-clip-path: circle(28px at center);''');
Node content;
+ int level;
- FloatingActionButton({ Object key, this.content }) : super(key: key);
+ FloatingActionButton({ Object key, this.content, this.level: 0 })
+ : super(key: key);
Node build() {
List<Node> children = [];
@@ -43,13 +44,17 @@ class FloatingActionButton extends Component {
if (content != null)
children.add(content);
+ List<Style> containerStyle = [_style];
+ if (level > 0)
+ containerStyle.add(Material.shadowStyle[level]);
+
return new Container(
key: "Container",
- style: _style,
+ styles: containerStyle,
children: [
new Material(
key: "Clip",
- style: _clipStyle,
+ styles: [_clipStyle],
children: children
)
]

Powered by Google App Engine
This is Rietveld 408576698