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

Unified Diff: sky/sdk/lib/framework/widgets/floating_action_button.dart

Issue 1179713004: Material and RaisedButton. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/sdk/lib/framework/widgets/floating_action_button.dart
diff --git a/sky/sdk/lib/framework/widgets/floating_action_button.dart b/sky/sdk/lib/framework/widgets/floating_action_button.dart
index 3aa9124665683f3ff021c194f5345bc45f4a81d4..dc3da829dbeed18e458e3c765595ecd92fb0163f 100644
--- a/sky/sdk/lib/framework/widgets/floating_action_button.dart
+++ b/sky/sdk/lib/framework/widgets/floating_action_button.dart
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'dart:sky' as sky;
-
-import '../painting/shadows.dart';
import '../theme2/colors.dart';
+import '../theme2/edges.dart';
+import 'button_base.dart';
import 'ink_well.dart';
import 'material.dart';
import 'wrappers.dart';
@@ -14,41 +13,26 @@ import 'wrappers.dart';
// http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
const double _kSize = 56.0;
-class FloatingActionButton extends Component {
+class FloatingActionButton extends ButtonBase {
- FloatingActionButton({ Object key, this.content, this.level: 0 })
+ FloatingActionButton({ Object key, this.child })
: super(key: key);
- final UINode content;
- final int level;
-
- UINode build() {
- List<UINode> children = [];
-
- if (content != null)
- children.add(content);
+ final UINode child;
+ UINode buildContent() {
return new Material(
- content: new CustomPaint(
- callback: (sky.Canvas canvas, Size size) {
- const double radius = _kSize / 2.0;
- sky.Paint paint = new sky.Paint()..color = Red[500];
- var builder = new ShadowDrawLooperBuilder()
- ..addShadow(const sky.Size(0.0, 5.0),
- const sky.Color(0x77000000),
- 5.0);
- paint.setDrawLooper(builder.build());
- canvas.drawCircle(radius, radius, radius, paint);
- },
- child: new ClipOval(
- child: new Container(
- width: _kSize,
- height: _kSize,
- child: new InkWell(children: children)
- )
+ child: new ClipOval(
+ child: new Container(
+ width: _kSize,
+ height: _kSize,
+ child: new InkWell(child: new Center(child: child))
)
),
- level: level);
+ color: Red[500],
+ edge: MaterialEdge.circle,
+ level: highlight ? 3 : 2
+ );
}
}
« no previous file with comments | « sky/sdk/lib/framework/widgets/fixed_height_scrollable.dart ('k') | sky/sdk/lib/framework/widgets/ink_well.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698